connectorv1

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bindable

type Bindable interface {
	Raw() ([]byte, error)
	Bind(any) error
}

type ConfigType

type ConfigType string
const (
	ConfigTypeYaml ConfigType = "yaml"
	ConfigTypeJson ConfigType = "json"
)

type Configuration

type Configuration interface {
	Bind(target any) error
	Raw() interface{}
}

type Connector

type Connector interface {
	// Start can be used to initialise your server or client
	// Note: This function should return and not block
	Start(ctx StartContext) error
	Stop(ctx StopContext) error
}

type ConnectorService

type ConnectorService interface {
	Start() error
}

func New

type Forwarder

type Forwarder interface {
	Logger
	Forward(name string, body []byte, headers Headers) (InboundResponse, error)
}

type Headers

type Headers = map[string]any

type InboundConnector

type InboundConnector interface {
	Connector
}

type InboundDescriptor

type InboundDescriptor interface {
	OutboundRequest
	Config() Bindable
}

type InboundResponse

type InboundResponse interface {
	MessageName() string
	Body() Bindable
	Headers() Headers
}

type Ingress

type Ingress interface {
	IngressHost() string
	IngressPort() int
}

type Logger

type Logger interface {
	LogError(err error, format string, v ...interface{})
	LogFatal(err error, format string, v ...interface{}) // this will crash the service
	LogInfo(format string, v ...interface{})
	LogWarn(format string, v ...interface{})
	LogDebug(format string, v ...interface{})
}

type OutboundConnector

type OutboundConnector interface {
	Connector
	HandleOutboundRequest(request OutboundRequest) (any, Headers, error) // see line 26, please
}

type OutboundDescriptor

type OutboundDescriptor interface {
	OutboundRequest
	Config() Bindable
}

type OutboundRequest

type OutboundRequest interface {
	Body() Bindable
	Headers() Headers
	MessageName() string
	MimeType() string
}

type StartContext

type StartContext interface {
	Config() Configuration
	Ingress(name string) (Ingress, error)
	InboundDescriptors() []InboundDescriptor
	OutboundDescriptors() []OutboundDescriptor
	Forwarder() Forwarder
}

type StopContext

type StopContext interface {
	Logger
}

Jump to

Keyboard shortcuts

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