Documentation ¶
Overview ¶
Package client TODO
Package client is a generated GoMock package.
Package client TODO
Index ¶
- Constants
- Variables
- func IsHitDMP(ctx context.Context, req *protocdmpproxyserver.GetDMPTagResultReq, ...) (bool, error)
- func RegisterCacheClient(client Client)
- func RegisterDMPClient(client DMPClient)
- type Client
- type DMPClient
- type DMPOption
- type MockClient
- func (m *MockClient) BatchGetExperimentBucketInfo(ctx context.Context, req *protoc_cache_server.BatchGetExperimentBucketReq) (*protoc_cache_server.BatchGetExperimentBucketResp, error)
- func (m *MockClient) BatchGetGroupBucketInfo(ctx context.Context, req *protoc_cache_server.BatchGetGroupBucketReq) (*protoc_cache_server.BatchGetGroupBucketResp, error)
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) GetTabConfigData(ctx context.Context, req *protoc_cache_server.GetTabConfigReq) (*protoc_cache_server.GetTabConfigResp, error)
- type MockClientMockRecorder
- type Option
Constants ¶
const ( // KeyToken TODO KeyToken = "X-Token" // KeyAK TODO KeyAK = "X-AK" // KeyET TODO KeyET = "X-ET" // KeyES TODO KeyES = "X-ES" )
Variables ¶
var ( // DC Abbreviation of dmpClient, the default dmp client DC = NewDMPClient() )
Functions ¶
func IsHitDMP ¶
func IsHitDMP(ctx context.Context, req *protocdmpproxyserver.GetDMPTagResultReq, dmpTag string) (bool, error)
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
func NewTABCacheClient ¶
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 ¶
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 ¶
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 ¶
func (m *MockClient) BatchGetExperimentBucketInfo(ctx context.Context, req *protoc_cache_server.BatchGetExperimentBucketReq) (*protoc_cache_server.BatchGetExperimentBucketResp, error)
BatchGetExperimentBucketInfo mocks base method.
func (*MockClient) BatchGetGroupBucketInfo ¶
func (m *MockClient) BatchGetGroupBucketInfo(ctx context.Context, req *protoc_cache_server.BatchGetGroupBucketReq) (*protoc_cache_server.BatchGetGroupBucketResp, error)
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 ¶
func (m *MockClient) GetTabConfigData(ctx context.Context, req *protoc_cache_server.GetTabConfigReq) (*protoc_cache_server.GetTabConfigResp, error)
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 WithHTTPClient ¶
WithHTTPClient Set http client, customize timeout and proxy