options

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeatureNamePrefix = "mikros_framework-"

	HttpFeatureName = FeatureNamePrefix + "http"

	HttpCorsFeatureName        = FeatureNamePrefix + "http_cors"
	HttpAuthFeatureName        = FeatureNamePrefix + "http_auth"
	TracingFeatureName         = FeatureNamePrefix + "tracing"
	TrackerFeatureName         = FeatureNamePrefix + "tracker"
	LoggerExtractorFeatureName = FeatureNamePrefix + "logger_extractor"
	PanicRecoveryFeatureName   = FeatureNamePrefix + "panic_recovery"
)

Internal feature names

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcClient

type GrpcClient struct {
	// ServiceName should be the service name.
	ServiceName service.Name

	// NewClientFunction should point to the service API function that can create
	// its gRPC client interface.
	NewClientFunction interface{}
}

GrpcClient is a structure to set information about a gRPC client that will be coupled by a service.

func (*GrpcClient) Validate

func (g *GrpcClient) Validate() error

type GrpcServiceOptions

type GrpcServiceOptions struct {
	ProtoServiceDescription *grpc.ServiceDesc
}

GrpcServiceOptions gathers options to initialize a gRPC service.

func (*GrpcServiceOptions) Kind

type HttpServiceOptions

type HttpServiceOptions struct {
	ProtoHttpServer httpServiceAPI.HttpServer
}

HttpServiceOptions gathers options to initialize a service as an HTTP service.

func (*HttpServiceOptions) Kind

type NativeServiceOptions

type NativeServiceOptions struct{}

func (*NativeServiceOptions) Kind

type NewServiceOptions

type NewServiceOptions struct {
	// Service must have all required service options according the types
	// defined in the 'service.toml' file. The same type name should be
	// used as key here.
	Service map[string]ServiceOptions `validate:"required"`

	// RunTimeFeatures must hold everything that will only be available
	// when the service executes. The key here should be the same as the
	// feature where the options will be sent.
	RunTimeFeatures map[string]interface{}

	// GrpcClients should have every gRPC dependency that the service
	// may have.
	GrpcClients map[string]*GrpcClient
}

NewServiceOptions gathers all the main options that one can use to create a new service.

func (*NewServiceOptions) Validate

func (o *NewServiceOptions) Validate() error

Validate validates if a NewServiceOptions object contains the required information initialized to proceed.

type ScriptServiceOptions

type ScriptServiceOptions struct{}

func (*ScriptServiceOptions) Kind

type ServiceOptions

type ServiceOptions interface {
	Kind() definition.ServiceType
}

ServiceOptions is an interface that all services options structure must implement.

Jump to

Keyboard shortcuts

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