providers

package
v0.0.0-...-3cc3ff2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HCLExtensionType  = "application/hcl"
	JSONExtensionType = "application/json"
)

Common file extension types

Functions

This section is empty.

Types

type AfterConstructor

AfterConstructor is called after the specifications is constructored

type AfterConstructorHandler

type AfterConstructorHandler func(AfterConstructor) AfterConstructor

AfterConstructorHandler wraps the after constructed function to allow middleware to be chained

type Collection

Collection represents a collection of specification lists and objects. These objects could be used to initialize a Semaphore broker.

func Resolve

func Resolve(ctx *broker.Context, mem functions.Collection, options Options) (Collection, error)

Resolve collects and constructs the a specs from the given options. The specifications are received from the providers. The property types are defined and functions are prepared. Once done is a specs collection returned that could be used to update the listeners.

type Option

type Option func(*broker.Context, *Options)

Option represents a constructor func which sets a given option

func WithAfterConstructor

func WithAfterConstructor(wrapper AfterConstructorHandler) Option

WithAfterConstructor the passed function gets called once all options have been applied

func WithDiscovery

func WithDiscovery(definition providers.ServiceDiscoveryClientsResolver) Option

func WithEndpoints

func WithEndpoints(definition providers.EndpointsResolver) Option

WithEndpoints appends the given endpoint resolver to the available endpoint resolvers

func WithListener

func WithListener(listener transport.NewListener) Option

WithListener appends the given listener to the collection of available listeners

func WithSchema

func WithSchema(resolver providers.SchemaResolver) Option

WithSchema appends the schema collection to the schema store

func WithServices

func WithServices(definition providers.ServicesResolver) Option

WithServices appends the given service resolver to the available service resolvers

type Options

type Options struct {
	semaphore.Options
	Listeners                 transport.ListenerList
	EndpointResolvers         providers.EndpointResolvers
	ServiceResolvers          providers.ServiceResolvers
	SchemaResolvers           providers.SchemaResolvers
	AfterConstructor          AfterConstructor
	DiscoveryServiceResolvers providers.ServiceDiscoveryClientsResolvers
}

Options represents the available options to resolve the given providers

func NewOptions

func NewOptions(ctx *broker.Context, core semaphore.Options, options ...Option) (Options, error)

NewOptions constructs a Options object from the given Option constructors

Jump to

Keyboard shortcuts

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