client

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package client TODO

Package client is a generated GoMock package.

Package client TODO

Index

Constants

View Source
const (
	// KeyToken TODO
	KeyToken = "X-Token"
	// KeyAK TODO
	KeyAK = "X-AK"
	// KeyET TODO
	KeyET = "X-ET"
	// KeyES TODO
	KeyES = "X-ES"
)

Variables

View Source
var (
	// DC Abbreviation of dmpClient, the default dmp client
	DC = NewDMPClient()
)

Functions

func IsHitDMP

IsHitDMP TODO

func RegisterCacheClient

func RegisterCacheClient(client Client)

RegisterCacheClient register client

func RegisterDMPClient

func RegisterDMPClient(client DMPClient)

RegisterDMPClient Register the dmp client. When using dmp to determine whether the dmp tag is hit, the underlying dmp client is transparent to the caller.

Types

type Client

type Client interface {
	// GetTabConfigData Get cache data, including experiments, configurations, switches, etc.
	GetTabConfigData(ctx context.Context, req *protoctabcacheserver.GetTabConfigReq) (
		*protoctabcacheserver.GetTabConfigResp, error)
	// BatchGetExperimentBucketInfo Get the experimental bucket information.
	// Only experiments on the double hash type layer have experimental bucket information.
	BatchGetExperimentBucketInfo(ctx context.Context, req *protoctabcacheserver.BatchGetExperimentBucketReq) (
		*protoctabcacheserver.BatchGetExperimentBucketResp, error)
	// BatchGetGroupBucketInfo Get the experimental group bucket information
	BatchGetGroupBucketInfo(ctx context.Context, req *protoctabcacheserver.BatchGetGroupBucketReq) (
		*protoctabcacheserver.BatchGetGroupBucketResp, error)
}

Client The cache service client abstract class can be used to customize the background cache service by implementing client

var (
	// CacheClient Default background cache service client,
	// Init defaults to using tab formal environment background cache service
	CacheClient Client = nil
)

func NewTABCacheClient

func NewTABCacheClient(opts ...Option) Client

NewTABCacheClient create tab server client

type DMPClient

type DMPClient interface {
	// BatchGetDMPTagResult Get the judgment results of unitID dmp tags in batches
	BatchGetDMPTagResult(ctx context.Context, req *protocdmpproxyserver.BatchGetDMPTagResultReq) (
		*protocdmpproxyserver.BatchGetDMPTagResultResp, error)
}

DMPClient dmp client definition, as an abstract class, shielding the underlying specific implementation

func NewDMPClient

func NewDMPClient(opts ...DMPOption) DMPClient

NewDMPClient Create a new dmp client

type DMPOption

type DMPOption func(client *tabDMPClient)

DMPOption Create a new option for dmp client, modify the backend address, request protocol, etc.

func WithEnvTypeOption

func WithEnvTypeOption(envType env.Type) DMPOption

WithEnvTypeOption Setting up the environment

type MockClient

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

MockClient is a mock of Client interface.

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) BatchGetExperimentBucketInfo

BatchGetExperimentBucketInfo mocks base method.

func (*MockClient) BatchGetGroupBucketInfo

BatchGetGroupBucketInfo mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) GetTabConfigData

GetTabConfigData mocks base method.

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient.

func (*MockClientMockRecorder) BatchGetExperimentBucketInfo

func (mr *MockClientMockRecorder) BatchGetExperimentBucketInfo(ctx, req interface{}) *gomock.Call

BatchGetExperimentBucketInfo indicates an expected call of BatchGetExperimentBucketInfo.

func (*MockClientMockRecorder) BatchGetGroupBucketInfo

func (mr *MockClientMockRecorder) BatchGetGroupBucketInfo(ctx, req interface{}) *gomock.Call

BatchGetGroupBucketInfo indicates an expected call of BatchGetGroupBucketInfo.

func (*MockClientMockRecorder) GetTabConfigData

func (mr *MockClientMockRecorder) GetTabConfigData(ctx, req interface{}) *gomock.Call

GetTabConfigData indicates an expected call of GetTabConfigData.

type Option

type Option func(client *tabCacheClient)

Option client option

func WithEnvType

func WithEnvType(envType env.Type) Option

WithEnvType Setting up the environment

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient Set http client, customize timeout and proxy

Jump to

Keyboard shortcuts

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