ochestrator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxSize = 4096
)

Variables

This section is empty.

Functions

func DefaultGorillaHub

func DefaultGorillaHub(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*gorillapub.GorillaHub, sabuhp.Handler, error)

func DefaultHTTPServer

func DefaultHTTPServer(
	_ context.Context,
	_ sabuhp.Logger,
	router *radar.Mux,
) (*serverpub.Server, error)

func DefaultInjector added in v0.2.1

func DefaultInjector(_ context.Context, _ sabuhp.Logger, _ *nenv.EnvStore) (*injectors.Injector, error)

func DefaultLocalMailerTransport

func DefaultLocalMailerTransport(
	ctx context.Context,
	logger sabuhp.Logger,
	_ sabuhp.Codec,
) (sabuhp.Transport, error)

func DefaultManager

func DefaultManager(
	ctx context.Context,
	id string,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*managers.Manager, error)

func DefaultRedisTransport

func DefaultRedisTransport(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
) (sabuhp.Transport, error)

func DefaultRedisTransportWithOptions

func DefaultRedisTransportWithOptions(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	redisOption redis.Options,
) (sabuhp.Transport, error)

func DefaultRouter

func DefaultRouter(
	ctx context.Context,
	logger sabuhp.Logger,
	manager *managers.Manager,
	transposer sabuhp.Transposer,
	translator sabuhp.Translator,
) (*radar.Mux, error)

func DefaultRouterWithNotFound

func DefaultRouterWithNotFound(
	ctx context.Context,
	logger sabuhp.Logger,
	manager *managers.Manager,
	notFound sabuhp.Handler,
	transposer sabuhp.Transposer,
	translator sabuhp.Translator,
) (*radar.Mux, error)

func DefaultSSEServer

func DefaultSSEServer(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*ssepub.SSEServer, error)

func DefaultTranslator added in v0.1.4

func DefaultTranslator(
	_ context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
) (sabuhp.Translator, error)

func DefaultTransposer

func DefaultTransposer(
	_ context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	maxSize int64,
) (sabuhp.Transposer, error)

func DefaultWorkerHub

func DefaultWorkerHub(
	ctx context.Context,
	logger sabuhp.Logger,
	injector *injectors.Injector,
	registry *actions.WorkerTemplateRegistry,
	transport sabuhp.Transport,
) (*actions.ActionHub, error)

func DefaultWorkerHubWithEscalation

func DefaultWorkerHubWithEscalation(
	ctx context.Context,
	logger sabuhp.Logger,
	injector *injectors.Injector,
	registry *actions.WorkerTemplateRegistry,
	transport sabuhp.Transport,
	escalations actions.EscalationNotification,
) (*actions.ActionHub, error)

func GobCodec

func GobCodec(
	_ context.Context,
	_ sabuhp.Logger,
) (sabuhp.Codec, error)

func JsonCodec

func JsonCodec(
	_ context.Context,
	_ sabuhp.Logger,
) (sabuhp.Codec, error)

func MessagePackCodec

func MessagePackCodec(
	_ context.Context,
	_ sabuhp.Logger,
) (sabuhp.Codec, error)

Types

type CodecCreator

type CodecCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
) (sabuhp.Codec, error)

type EnvConfigCreator added in v0.2.4

type EnvConfigCreator func(ctx context.Context, logger sabuhp.Logger) (*nenv.EnvStore, error)

func DefaultEnvConfigCreator added in v0.2.4

func DefaultEnvConfigCreator(prefix string) EnvConfigCreator

type GorillaHubCreator

type GorillaHubCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*gorillapub.GorillaHub, sabuhp.Handler, error)

type HttpServerCreator

type HttpServerCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	router *radar.Mux,
) (*serverpub.Server, error)

type InjectorCreator added in v0.2.1

type InjectorCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	envConfig *nenv.EnvStore,
) (*injectors.Injector, error)

type ManagerCreator

type ManagerCreator func(
	ctx context.Context,
	id string,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*managers.Manager, error)

type RouterCreator

type RouterCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	manager *managers.Manager,
	transposer sabuhp.Transposer,
	translator sabuhp.Translator,
) (*radar.Mux, error)

type SSEServerCreator

type SSEServerCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	transport sabuhp.Transport,
) (*ssepub.SSEServer, error)

type Station

type Station struct {
	Id string

	// Register will indicate if handler for websocket and sse server if
	// created will be automatically added into the /streams/sse and /streams/ws
	// endpoints. If set to false, then user is giving freedom to set their own paths
	// on the Router.
	RegisterHandlers bool

	Addr           string
	Logger         sabuhp.Logger
	Ctx            context.Context
	WorkerRegistry *actions.WorkerTemplateRegistry

	// creator functions
	CreateEnvConfig  EnvConfigCreator
	CreateCodec      CodecCreator
	CreateInjector   InjectorCreator
	CreateTransposer TransposerCreator
	CreateTransport  TransportCreator
	CreateManager    ManagerCreator
	CreateWorkerHub  WorkerHubCreator
	CreateRouter     RouterCreator
	CreateServer     HttpServerCreator
	CreateTranslator TranslatorCreator
	CreateSSEServer  SSEServerCreator
	CreateWebsocket  GorillaHubCreator
	// contains filtered or unexported fields
}

func DefaultLocalTransportStation

func DefaultLocalTransportStation(
	ctx context.Context,
	id string,
	addr string,
	logger sabuhp.Logger,
	registry *actions.WorkerTemplateRegistry,
) *Station

DefaultStation returns a station using a LocalMailer backed transport layer and MessagePack codec.

func DefaultStation

func DefaultStation(
	ctx context.Context,
	id string,
	addr string,
	logger sabuhp.Logger,
	registry *actions.WorkerTemplateRegistry,
) *Station

DefaultStation returns a station using a redis backed transport layer and MessagePack codec.

func NewStation

func NewStation(
	ctx context.Context,
	id string,
	addr string,
	logger sabuhp.Logger,
	registry *actions.WorkerTemplateRegistry,
) *Station

NewStation returns a new instance of a station.

func (*Station) Codec

func (s *Station) Codec() sabuhp.Codec

func (*Station) EnvConfig added in v0.2.4

func (s *Station) EnvConfig() *nenv.EnvStore

func (*Station) HttpHealth

func (s *Station) HttpHealth() serverpub.HealthPinger

func (*Station) HttpServer

func (s *Station) HttpServer() *serverpub.Server

func (*Station) Init

func (s *Station) Init() error

func (*Station) Injector added in v0.2.1

func (s *Station) Injector() *injectors.Injector

func (*Station) Manager

func (s *Station) Manager() *managers.Manager

func (*Station) Router

func (s *Station) Router() *radar.Mux

func (*Station) SSEServer

func (s *Station) SSEServer() *ssepub.SSEServer

func (*Station) Translator added in v0.1.4

func (s *Station) Translator() sabuhp.Translator

func (*Station) Transport

func (s *Station) Transport() sabuhp.Transport

func (*Station) Transposer

func (s *Station) Transposer() sabuhp.Transposer

func (*Station) Wait

func (s *Station) Wait() error

func (*Station) WebsocketHandler

func (s *Station) WebsocketHandler() sabuhp.Handler

func (*Station) WebsocketHub

func (s *Station) WebsocketHub() *gorillapub.GorillaHub

func (*Station) Workers

func (s *Station) Workers() *actions.ActionHub

type TranslatorCreator added in v0.1.4

type TranslatorCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
) (sabuhp.Translator, error)

type TransportCreator

type TransportCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
) (sabuhp.Transport, error)

func RedisTransportWithOptions added in v0.1.4

func RedisTransportWithOptions(config redis.Options) TransportCreator

type TransposerCreator

type TransposerCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	codec sabuhp.Codec,
	maxSize int64,
) (sabuhp.Transposer, error)

type WorkerHubCreator

type WorkerHubCreator func(
	ctx context.Context,
	logger sabuhp.Logger,
	injector *injectors.Injector,
	registry *actions.WorkerTemplateRegistry,
	transport sabuhp.Transport,
) (*actions.ActionHub, error)

Jump to

Keyboard shortcuts

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