client

package
v0.0.0-...-c04dacf Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientNodeMap

func NewClientNodeMap() *clientNodeMap

func NewMessagingClient

func NewMessagingClient(failedChannel chan registry.NodeEvent, options ...ClientNodeOption) *messagingClient

func NewResponseMap

func NewResponseMap() *responseMap

func NewSubscriberMap

func NewSubscriberMap() *subscriberMap

Types

type BadMessageTypeError

type BadMessageTypeError struct {
	Expected string
	Actual   string
}

func (*BadMessageTypeError) Error

func (err *BadMessageTypeError) Error() string

type ClientNode

type ClientNode struct {
	registry.Node
	proto.MessageClient
	CurrentId string
}

func NewClientNode

func NewClientNode(node registry.Node, currrentId string, optionFuncs ...ClientNodeOption) (*ClientNode, error)

func (*ClientNode) AttemptMessage

func (client *ClientNode) AttemptMessage(ctx context.Context, msg messaging.Message) error

type ClientNodeMapper

type ClientNodeMapper interface {
	Node(string) (*ClientNode, error)
	AddClientNode(ClientNode)
	RemoveClientNode(string)
	FanClientNodeMessaging(context.Context, messaging.Message, <-chan string) chan registry.Node
}

type ClientNodeOption

type ClientNodeOption func(c *ClientNodeOptions) *ClientNodeOptions

func WithClientRetryOptions

func WithClientRetryOptions(input ClientRetryOptionsInput) ClientNodeOption

func WithDialOptions

func WithDialOptions(option ...grpc.DialOption) ClientNodeOption

WithDialOption sets the dial options for gRPC connections in the client

func WithInsecure

func WithInsecure() ClientNodeOption

WithDialOption sets the dial options for gRPC connections in the client

type ClientNodeOptions

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

type ClientRetryOptionsInput

type ClientRetryOptionsInput struct {
	MaxAttempts     uint
	BackOff         time.Duration
	Jitter          float64
	PerRetryTimeout time.Duration
}

type ContextDoneUnsentMessageError

type ContextDoneUnsentMessageError struct {
	MessageId string
}

func (*ContextDoneUnsentMessageError) Error

type ResponseMapper

type ResponseMapper interface {
	PushResponse(messaging.ResponseInfo)
	GenerateIdsByMessage(string) (<-chan string, error)
}

type SubMapper

type SubMapper interface {
	AddSubscriber(string, ...string)
	RemoveSubscriber(string, ...string)
	Subscribers(string) ([]string, error)
	GenerateIdsBySubject(string) (<-chan string, error)
}

type UnknownNodeEventError

type UnknownNodeEventError struct {
	Event string
	Id    string
}

func (*UnknownNodeEventError) Error

func (err *UnknownNodeEventError) Error() string

type UnregisteredClientNodeError

type UnregisteredClientNodeError struct {
	Id string
}

func (*UnregisteredClientNodeError) Error

func (err *UnregisteredClientNodeError) Error() string

type UnregisteredResponseError

type UnregisteredResponseError struct {
	MessageId string
}

func (*UnregisteredResponseError) Error

func (err *UnregisteredResponseError) Error() string

type UnregisteredSubjectError

type UnregisteredSubjectError struct {
	Subject string
}

func (*UnregisteredSubjectError) Error

func (err *UnregisteredSubjectError) Error() string

type UnregisteredSubscriberError

type UnregisteredSubscriberError struct {
	Method  string
	Subject string
}

func (*UnregisteredSubscriberError) Error

func (err *UnregisteredSubscriberError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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