role

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package role is generated code used to make or handle TChannel calls using Thrift.

Index

Constants

This section is empty.

Variables

View Source
var GoUnusedProtection__ int
View Source
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 RoleService interface {
	// Parameters:
	//  - Role
	SetRole(role string) (err error)
	// Parameters:
	//  - Role
	GetMembers(role string) (r []string, err error)
}

type RoleServiceClient

type RoleServiceClient struct {
	Transport       thrift.TTransport
	ProtocolFactory thrift.TProtocolFactory
	InputProtocol   thrift.TProtocol
	OutputProtocol  thrift.TProtocol
	SeqId           int32
}

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 (*RoleServiceGetMembersArgs) String

func (p *RoleServiceGetMembersArgs) String() string

func (*RoleServiceGetMembersArgs) Write

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 (*RoleServiceGetMembersResult) String

func (p *RoleServiceGetMembersResult) String() string

func (*RoleServiceGetMembersResult) Write

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 (*RoleServiceSetRoleArgs) String

func (p *RoleServiceSetRoleArgs) String() string

func (*RoleServiceSetRoleArgs) Write

func (p *RoleServiceSetRoleArgs) Write(oprot thrift.TProtocol) error

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 (*RoleServiceSetRoleResult) String

func (p *RoleServiceSetRoleResult) String() string

func (*RoleServiceSetRoleResult) Write

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.

Jump to

Keyboard shortcuts

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