manager

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMetaUrl  = "https://datarangers.com.cn/abmeta/v2/get_abtest_info?token=%s&sideType=%s"
	DefaultMetaPath = "/abmeta/v2/get_abtest_info?token=%s&sideType=%s"
)

meta url

View Source
const (
	DefaultUpdateInterval = 1 * time.Minute
	LastModified          = "Modify_time"
)

Variables

This section is empty.

Functions

func AdaptHost

func AdaptHost(host string) string

Types

type DynamicMetaManager

type DynamicMetaManager struct {
	LastModified int
	StaticMetaManager
	// contains filtered or unexported fields
}

func NewDynamicMetaManager

func NewDynamicMetaManager(token string, options ...MetaOptionFunc) *DynamicMetaManager

func NewDynamicMetaManager4Test

func NewDynamicMetaManager4Test(meta string) *DynamicMetaManager

func (*DynamicMetaManager) GetFetchUrl

func (d *DynamicMetaManager) GetFetchUrl() string

func (*DynamicMetaManager) SetFetchUrl

func (d *DynamicMetaManager) SetFetchUrl(url string)

type MetaManager

type MetaManager interface {
	SetConfig(meta []byte)
	GetConfig() *config.ProductConfig
}

type MetaOptionFunc added in v1.0.3

type MetaOptionFunc func(*DynamicMetaManager)

func WithFetchInterval

func WithFetchInterval(interval time.Duration) MetaOptionFunc

func WithMetaHost

func WithMetaHost(host string) MetaOptionFunc

func WithRequester

func WithRequester(requester *httper.HRequester) MetaOptionFunc

func WithTrackHost

func WithTrackHost(host string) MetaOptionFunc

type MetaSideType

type MetaSideType string
const (
	SERVER MetaSideType = "server"
)

type StaticMetaManager

type StaticMetaManager struct {
	// contains filtered or unexported fields
}

func NewStaticMetaManager

func NewStaticMetaManager(metafile []byte) *StaticMetaManager

func (*StaticMetaManager) GetConfig

func (s *StaticMetaManager) GetConfig() *config.ProductConfig

func (*StaticMetaManager) SetConfig

func (s *StaticMetaManager) SetConfig(metafile []byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL