Documentation ¶
Overview ¶
Package keyvalue is generated code used to make or handle TChannel calls using Thrift.
Index ¶
- Variables
- func NewTChanKeyValueServiceInheritedClient(thriftService string, client thrift.TChanClient) *tchanKeyValueServiceClient
- func NewTChanKeyValueServiceServer(handler TChanKeyValueService) thrift.TChanServer
- type KeyValueService
- type KeyValueServiceClient
- type KeyValueServiceConfiguration
- type KeyValueServiceGetAllArgs
- type KeyValueServiceGetAllConfiguration
- type KeyValueServiceGetAllResult
- func (p *KeyValueServiceGetAllResult) GetSuccess() []string
- func (p *KeyValueServiceGetAllResult) IsSetSuccess() bool
- func (p *KeyValueServiceGetAllResult) Read(iprot thrift.TProtocol) error
- func (p *KeyValueServiceGetAllResult) String() string
- func (p *KeyValueServiceGetAllResult) Write(oprot thrift.TProtocol) error
- type KeyValueServiceGetArgs
- type KeyValueServiceGetConfiguration
- type KeyValueServiceGetResult
- func (p *KeyValueServiceGetResult) GetSuccess() string
- func (p *KeyValueServiceGetResult) IsSetSuccess() bool
- func (p *KeyValueServiceGetResult) Read(iprot thrift.TProtocol) error
- func (p *KeyValueServiceGetResult) String() string
- func (p *KeyValueServiceGetResult) Write(oprot thrift.TProtocol) error
- type KeyValueServiceProcessor
- func (p *KeyValueServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
- func (p *KeyValueServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
- func (p *KeyValueServiceProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
- func (p *KeyValueServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
- type KeyValueServiceSetArgs
- type KeyValueServiceSetConfiguration
- type KeyValueServiceSetResult
- type RingpopKeyValueServiceAdapter
- func (a *RingpopKeyValueServiceAdapter) Get(ctx thrift.Context, key string) (r string, err error)
- func (a *RingpopKeyValueServiceAdapter) GetAll(ctx thrift.Context, keys []string) (r []string, err error)
- func (a *RingpopKeyValueServiceAdapter) GetLocalClient() interface{}
- func (a *RingpopKeyValueServiceAdapter) MakeRemoteClient(client thrift.TChanClient) interface{}
- func (a *RingpopKeyValueServiceAdapter) Set(ctx thrift.Context, key string, value string) (err error)
- type TChanKeyValueService
Constants ¶
This section is empty.
Variables ¶
var GoUnusedProtection__ int
var KeyValueServiceGetAllResult_Success_DEFAULT []string
var KeyValueServiceGetResult_Success_DEFAULT string
Functions ¶
func NewTChanKeyValueServiceInheritedClient ¶
func NewTChanKeyValueServiceInheritedClient(thriftService string, client thrift.TChanClient) *tchanKeyValueServiceClient
func NewTChanKeyValueServiceServer ¶
func NewTChanKeyValueServiceServer(handler TChanKeyValueService) thrift.TChanServer
NewTChanKeyValueServiceServer wraps a handler for TChanKeyValueService so it can be registered with a thrift.Server.
Types ¶
type KeyValueService ¶
type KeyValueServiceClient ¶
type KeyValueServiceClient struct { Transport thrift.TTransport ProtocolFactory thrift.TProtocolFactory InputProtocol thrift.TProtocol OutputProtocol thrift.TProtocol SeqId int32 }
func NewKeyValueServiceClientFactory ¶
func NewKeyValueServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *KeyValueServiceClient
func NewKeyValueServiceClientProtocol ¶
func NewKeyValueServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *KeyValueServiceClient
func (*KeyValueServiceClient) Get ¶
func (p *KeyValueServiceClient) Get(key string) (r string, err error)
Parameters:
- Key
type KeyValueServiceConfiguration ¶
type KeyValueServiceConfiguration struct { // Get holds the forwarding configuration for the Get endpoint defined in the service Get *KeyValueServiceGetConfiguration // GetAll holds the forwarding configuration for the GetAll endpoint defined in the service GetAll *KeyValueServiceGetAllConfiguration // Set holds the forwarding configuration for the Set endpoint defined in the service Set *KeyValueServiceSetConfiguration }
KeyValueServiceConfiguration contains the forwarding configuration for the KeyValueService service. It has a field for every endpoint defined in the service. In this field the endpoint specific forward configuration can be stored. Populating these fields is optional, default behaviour is to call the service implementation locally to the process where the call came in.
type KeyValueServiceGetAllArgs ¶
type KeyValueServiceGetAllArgs struct {
Keys []string `thrift:"keys,1" json:"keys"`
}
Attributes:
- Keys
func NewKeyValueServiceGetAllArgs ¶
func NewKeyValueServiceGetAllArgs() *KeyValueServiceGetAllArgs
func (*KeyValueServiceGetAllArgs) GetKeys ¶
func (p *KeyValueServiceGetAllArgs) GetKeys() []string
func (*KeyValueServiceGetAllArgs) Read ¶
func (p *KeyValueServiceGetAllArgs) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceGetAllArgs) String ¶
func (p *KeyValueServiceGetAllArgs) String() string
type KeyValueServiceGetAllConfiguration ¶
type KeyValueServiceGetAllConfiguration struct { // Key is a closure that generates a routable key based on the parameters of the incomming request. Key func(ctx thrift.Context, keys []string) (string, error) }
KeyValueServiceGetAllConfiguration contains the configuration on how to route calls to the thrift endpoint KeyValueService::GetAll.
type KeyValueServiceGetAllResult ¶
type KeyValueServiceGetAllResult struct {
Success []string `thrift:"success,0" json:"success,omitempty"`
}
Attributes:
- Success
func NewKeyValueServiceGetAllResult ¶
func NewKeyValueServiceGetAllResult() *KeyValueServiceGetAllResult
func (*KeyValueServiceGetAllResult) GetSuccess ¶
func (p *KeyValueServiceGetAllResult) GetSuccess() []string
func (*KeyValueServiceGetAllResult) IsSetSuccess ¶
func (p *KeyValueServiceGetAllResult) IsSetSuccess() bool
func (*KeyValueServiceGetAllResult) Read ¶
func (p *KeyValueServiceGetAllResult) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceGetAllResult) String ¶
func (p *KeyValueServiceGetAllResult) String() string
type KeyValueServiceGetArgs ¶
type KeyValueServiceGetArgs struct {
Key string `thrift:"key,1" json:"key"`
}
Attributes:
- Key
func NewKeyValueServiceGetArgs ¶
func NewKeyValueServiceGetArgs() *KeyValueServiceGetArgs
func (*KeyValueServiceGetArgs) GetKey ¶
func (p *KeyValueServiceGetArgs) GetKey() string
func (*KeyValueServiceGetArgs) Read ¶
func (p *KeyValueServiceGetArgs) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceGetArgs) String ¶
func (p *KeyValueServiceGetArgs) String() string
type KeyValueServiceGetConfiguration ¶
type KeyValueServiceGetConfiguration struct { // Key is a closure that generates a routable key based on the parameters of the incomming request. Key func(ctx thrift.Context, key string) (string, error) }
KeyValueServiceGetConfiguration contains the configuration on how to route calls to the thrift endpoint KeyValueService::Get.
type KeyValueServiceGetResult ¶
type KeyValueServiceGetResult struct {
Success *string `thrift:"success,0" json:"success,omitempty"`
}
Attributes:
- Success
func NewKeyValueServiceGetResult ¶
func NewKeyValueServiceGetResult() *KeyValueServiceGetResult
func (*KeyValueServiceGetResult) GetSuccess ¶
func (p *KeyValueServiceGetResult) GetSuccess() string
func (*KeyValueServiceGetResult) IsSetSuccess ¶
func (p *KeyValueServiceGetResult) IsSetSuccess() bool
func (*KeyValueServiceGetResult) Read ¶
func (p *KeyValueServiceGetResult) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceGetResult) String ¶
func (p *KeyValueServiceGetResult) String() string
type KeyValueServiceProcessor ¶
type KeyValueServiceProcessor struct {
// contains filtered or unexported fields
}
func NewKeyValueServiceProcessor ¶
func NewKeyValueServiceProcessor(handler KeyValueService) *KeyValueServiceProcessor
func (*KeyValueServiceProcessor) AddToProcessorMap ¶
func (p *KeyValueServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
func (*KeyValueServiceProcessor) GetProcessorFunction ¶
func (p *KeyValueServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
func (*KeyValueServiceProcessor) Process ¶
func (p *KeyValueServiceProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
func (*KeyValueServiceProcessor) ProcessorMap ¶
func (p *KeyValueServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
type KeyValueServiceSetArgs ¶
type KeyValueServiceSetArgs struct { Key string `thrift:"key,1" json:"key"` Value string `thrift:"value,2" json:"value"` }
Attributes:
- Key
- Value
func NewKeyValueServiceSetArgs ¶
func NewKeyValueServiceSetArgs() *KeyValueServiceSetArgs
func (*KeyValueServiceSetArgs) GetKey ¶
func (p *KeyValueServiceSetArgs) GetKey() string
func (*KeyValueServiceSetArgs) GetValue ¶
func (p *KeyValueServiceSetArgs) GetValue() string
func (*KeyValueServiceSetArgs) Read ¶
func (p *KeyValueServiceSetArgs) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceSetArgs) String ¶
func (p *KeyValueServiceSetArgs) String() string
type KeyValueServiceSetConfiguration ¶
type KeyValueServiceSetConfiguration struct { // Key is a closure that generates a routable key based on the parameters of the incomming request. Key func(ctx thrift.Context, key string, value string) (string, error) }
KeyValueServiceSetConfiguration contains the configuration on how to route calls to the thrift endpoint KeyValueService::Set.
type KeyValueServiceSetResult ¶
type KeyValueServiceSetResult struct { }
func NewKeyValueServiceSetResult ¶
func NewKeyValueServiceSetResult() *KeyValueServiceSetResult
func (*KeyValueServiceSetResult) Read ¶
func (p *KeyValueServiceSetResult) Read(iprot thrift.TProtocol) error
func (*KeyValueServiceSetResult) String ¶
func (p *KeyValueServiceSetResult) String() string
type RingpopKeyValueServiceAdapter ¶
type RingpopKeyValueServiceAdapter struct {
// contains filtered or unexported fields
}
func (*RingpopKeyValueServiceAdapter) Get ¶
Get satisfies the TChanKeyValueService interface. This function uses the configuration for Get to determine the host to execute the call on. When it decides the call needs to be executed in the current process it will forward the invocation to its local implementation.
func (*RingpopKeyValueServiceAdapter) GetAll ¶
func (a *RingpopKeyValueServiceAdapter) GetAll(ctx thrift.Context, keys []string) (r []string, err error)
GetAll satisfies the TChanKeyValueService interface. This function uses the configuration for GetAll to determine the host to execute the call on. When it decides the call needs to be executed in the current process it will forward the invocation to its local implementation.
func (*RingpopKeyValueServiceAdapter) GetLocalClient ¶
func (a *RingpopKeyValueServiceAdapter) GetLocalClient() interface{}
GetLocalClient satisfies the ClientFactory interface of ringpop-go/router
func (*RingpopKeyValueServiceAdapter) MakeRemoteClient ¶
func (a *RingpopKeyValueServiceAdapter) MakeRemoteClient(client thrift.TChanClient) interface{}
MakeRemoteClient satisfies the ClientFactory interface of ringpop-go/router
func (*RingpopKeyValueServiceAdapter) Set ¶
func (a *RingpopKeyValueServiceAdapter) Set(ctx thrift.Context, key string, value string) (err error)
Set satisfies the TChanKeyValueService interface. This function uses the configuration for Set to determine the host to execute the call on. When it decides the call needs to be executed in the current process it will forward the invocation to its local implementation.
type TChanKeyValueService ¶
type TChanKeyValueService interface { Get(ctx thrift.Context, key string) (string, error) GetAll(ctx thrift.Context, keys []string) ([]string, error) Set(ctx thrift.Context, key string, value string) error }
TChanKeyValueService is the interface that defines the server handler and client interface.
func NewRingpopKeyValueServiceAdapter ¶
func NewRingpopKeyValueServiceAdapter( impl TChanKeyValueService, rp ringpop.Interface, ch *tchannel.Channel, config KeyValueServiceConfiguration, ) (TChanKeyValueService, error)
Set: &KeyValueServiceSetConfiguration: { Key: func(ctx thrift.Context, key string, value string) (shardKey string, err error) { return "calculated-shard-key", nil }, }, },
) server.Register(NewTChanKeyValueServiceServer(adapter))
func NewTChanKeyValueServiceClient ¶
func NewTChanKeyValueServiceClient(client thrift.TChanClient) TChanKeyValueService
NewTChanKeyValueServiceClient creates a client that can be used to make remote calls.