Documentation ¶
Overview ¶
Package role is generated code used to make or handle TChannel calls using Thrift.
Index ¶
- Variables
- func NewTChanRoleServiceInheritedClient(thriftService string, client thrift.TChanClient) *tchanRoleServiceClient
- func NewTChanRoleServiceServer(handler TChanRoleService) thrift.TChanServer
- type RingpopRoleServiceAdapter
- func (a *RingpopRoleServiceAdapter) GetLocalClient() interface{}
- func (a *RingpopRoleServiceAdapter) GetMembers(ctx thrift.Context, role string) (r []string, err error)
- func (a *RingpopRoleServiceAdapter) MakeRemoteClient(client thrift.TChanClient) interface{}
- func (a *RingpopRoleServiceAdapter) SetRole(ctx thrift.Context, role string) (err error)
- type RoleService
- type RoleServiceClient
- type RoleServiceConfiguration
- type RoleServiceGetMembersArgs
- type RoleServiceGetMembersConfiguration
- type RoleServiceGetMembersResult
- func (p *RoleServiceGetMembersResult) GetSuccess() []string
- func (p *RoleServiceGetMembersResult) IsSetSuccess() bool
- func (p *RoleServiceGetMembersResult) Read(iprot thrift.TProtocol) error
- func (p *RoleServiceGetMembersResult) String() string
- func (p *RoleServiceGetMembersResult) Write(oprot thrift.TProtocol) error
- type RoleServiceProcessor
- func (p *RoleServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
- func (p *RoleServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
- func (p *RoleServiceProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
- func (p *RoleServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
- type RoleServiceSetRoleArgs
- type RoleServiceSetRoleConfiguration
- type RoleServiceSetRoleResult
- type TChanRoleService
Constants ¶
This section is empty.
Variables ¶
var GoUnusedProtection__ int
var RoleServiceGetMembersResult_Success_DEFAULT []string
Functions ¶
func NewTChanRoleServiceInheritedClient ¶
func NewTChanRoleServiceInheritedClient(thriftService string, client thrift.TChanClient) *tchanRoleServiceClient
func NewTChanRoleServiceServer ¶
func NewTChanRoleServiceServer(handler TChanRoleService) thrift.TChanServer
NewTChanRoleServiceServer wraps a handler for TChanRoleService so it can be registered with a thrift.Server.
Types ¶
type RingpopRoleServiceAdapter ¶
type RingpopRoleServiceAdapter struct {
// contains filtered or unexported fields
}
func (*RingpopRoleServiceAdapter) GetLocalClient ¶
func (a *RingpopRoleServiceAdapter) GetLocalClient() interface{}
GetLocalClient satisfies the ClientFactory interface of ringpop-go/router
func (*RingpopRoleServiceAdapter) GetMembers ¶
func (a *RingpopRoleServiceAdapter) GetMembers(ctx thrift.Context, role string) (r []string, err error)
GetMembers satisfies the TChanRoleService interface. This function uses the configuration for GetMembers 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 (*RingpopRoleServiceAdapter) MakeRemoteClient ¶
func (a *RingpopRoleServiceAdapter) MakeRemoteClient(client thrift.TChanClient) interface{}
MakeRemoteClient satisfies the ClientFactory interface of ringpop-go/router
func (*RingpopRoleServiceAdapter) SetRole ¶
func (a *RingpopRoleServiceAdapter) SetRole(ctx thrift.Context, role string) (err error)
SetRole satisfies the TChanRoleService interface. This function uses the configuration for SetRole 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 RoleService ¶
type RoleServiceClient ¶
type RoleServiceClient struct { Transport thrift.TTransport ProtocolFactory thrift.TProtocolFactory InputProtocol thrift.TProtocol OutputProtocol thrift.TProtocol SeqId int32 }
func NewRoleServiceClientFactory ¶
func NewRoleServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *RoleServiceClient
func NewRoleServiceClientProtocol ¶
func NewRoleServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *RoleServiceClient
func (*RoleServiceClient) GetMembers ¶
func (p *RoleServiceClient) GetMembers(role string) (r []string, err error)
Parameters:
- Role
func (*RoleServiceClient) SetRole ¶
func (p *RoleServiceClient) SetRole(role string) (err error)
Parameters:
- Role
type RoleServiceConfiguration ¶
type RoleServiceConfiguration struct { // GetMembers holds the forwarding configuration for the GetMembers endpoint defined in the service GetMembers *RoleServiceGetMembersConfiguration // SetRole holds the forwarding configuration for the SetRole endpoint defined in the service SetRole *RoleServiceSetRoleConfiguration }
RoleServiceConfiguration contains the forwarding configuration for the RoleService 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 RoleServiceGetMembersArgs ¶
type RoleServiceGetMembersArgs struct {
Role string `thrift:"role,1" json:"role"`
}
Attributes:
- Role
func NewRoleServiceGetMembersArgs ¶
func NewRoleServiceGetMembersArgs() *RoleServiceGetMembersArgs
func (*RoleServiceGetMembersArgs) GetRole ¶
func (p *RoleServiceGetMembersArgs) GetRole() string
func (*RoleServiceGetMembersArgs) Read ¶
func (p *RoleServiceGetMembersArgs) Read(iprot thrift.TProtocol) error
func (*RoleServiceGetMembersArgs) String ¶
func (p *RoleServiceGetMembersArgs) String() string
type RoleServiceGetMembersConfiguration ¶
type RoleServiceGetMembersConfiguration struct { // Key is a closure that generates a routable key based on the parameters of the incomming request. Key func(ctx thrift.Context, role string) (string, error) }
RoleServiceGetMembersConfiguration contains the configuration on how to route calls to the thrift endpoint RoleService::GetMembers.
type RoleServiceGetMembersResult ¶
type RoleServiceGetMembersResult struct {
Success []string `thrift:"success,0" json:"success,omitempty"`
}
Attributes:
- Success
func NewRoleServiceGetMembersResult ¶
func NewRoleServiceGetMembersResult() *RoleServiceGetMembersResult
func (*RoleServiceGetMembersResult) GetSuccess ¶
func (p *RoleServiceGetMembersResult) GetSuccess() []string
func (*RoleServiceGetMembersResult) IsSetSuccess ¶
func (p *RoleServiceGetMembersResult) IsSetSuccess() bool
func (*RoleServiceGetMembersResult) Read ¶
func (p *RoleServiceGetMembersResult) Read(iprot thrift.TProtocol) error
func (*RoleServiceGetMembersResult) String ¶
func (p *RoleServiceGetMembersResult) String() string
type RoleServiceProcessor ¶
type RoleServiceProcessor struct {
// contains filtered or unexported fields
}
func NewRoleServiceProcessor ¶
func NewRoleServiceProcessor(handler RoleService) *RoleServiceProcessor
func (*RoleServiceProcessor) AddToProcessorMap ¶
func (p *RoleServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)
func (*RoleServiceProcessor) GetProcessorFunction ¶
func (p *RoleServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)
func (*RoleServiceProcessor) Process ¶
func (p *RoleServiceProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)
func (*RoleServiceProcessor) ProcessorMap ¶
func (p *RoleServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction
type RoleServiceSetRoleArgs ¶
type RoleServiceSetRoleArgs struct {
Role string `thrift:"role,1" json:"role"`
}
Attributes:
- Role
func NewRoleServiceSetRoleArgs ¶
func NewRoleServiceSetRoleArgs() *RoleServiceSetRoleArgs
func (*RoleServiceSetRoleArgs) GetRole ¶
func (p *RoleServiceSetRoleArgs) GetRole() string
func (*RoleServiceSetRoleArgs) Read ¶
func (p *RoleServiceSetRoleArgs) Read(iprot thrift.TProtocol) error
func (*RoleServiceSetRoleArgs) String ¶
func (p *RoleServiceSetRoleArgs) String() string
type RoleServiceSetRoleConfiguration ¶
type RoleServiceSetRoleConfiguration struct { // Key is a closure that generates a routable key based on the parameters of the incomming request. Key func(ctx thrift.Context, role string) (string, error) }
RoleServiceSetRoleConfiguration contains the configuration on how to route calls to the thrift endpoint RoleService::SetRole.
type RoleServiceSetRoleResult ¶
type RoleServiceSetRoleResult struct { }
func NewRoleServiceSetRoleResult ¶
func NewRoleServiceSetRoleResult() *RoleServiceSetRoleResult
func (*RoleServiceSetRoleResult) Read ¶
func (p *RoleServiceSetRoleResult) Read(iprot thrift.TProtocol) error
func (*RoleServiceSetRoleResult) String ¶
func (p *RoleServiceSetRoleResult) String() string
type TChanRoleService ¶
type TChanRoleService interface { GetMembers(ctx thrift.Context, role string) ([]string, error) SetRole(ctx thrift.Context, role string) error }
TChanRoleService is the interface that defines the server handler and client interface.
func NewRingpopRoleServiceAdapter ¶
func NewRingpopRoleServiceAdapter( impl TChanRoleService, rp ringpop.Interface, ch *tchannel.Channel, config RoleServiceConfiguration, ) (TChanRoleService, error)
SetRole: &RoleServiceSetRoleConfiguration: { Key: func(ctx thrift.Context, role string) (shardKey string, err error) { return "calculated-shard-key", nil }, }, },
) server.Register(NewTChanRoleServiceServer(adapter))
func NewTChanRoleServiceClient ¶
func NewTChanRoleServiceClient(client thrift.TChanClient) TChanRoleService
NewTChanRoleServiceClient creates a client that can be used to make remote calls.