server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorEmptyEndpoint = errors.New("grpc server plugin used but not initialization")
View Source
var ErrorEmptyHttpEndpoint = errors.New("http server plugin used but not initialization")

Functions

func NewGrpcServerPlugin

func NewGrpcServerPlugin(grpcServerFn func(ctx context.Context) *grpc.Server, services ...GrpcService) application.Plugin

func NewHttpServerPlugin

func NewHttpServerPlugin(handlerFn func(ctx context.Context) http.Handler) application.Plugin

Types

type GrpcServerPlugin

type GrpcServerPlugin struct {
	application.Plugin `yaml:"-"`
	// contains filtered or unexported fields
}

func (*GrpcServerPlugin) Config

func (g *GrpcServerPlugin) Config(_ context.Context, conf []byte) error

func (*GrpcServerPlugin) DiscoverTheEntrance

func (g *GrpcServerPlugin) DiscoverTheEntrance() (string, error)

func (*GrpcServerPlugin) Init

func (g *GrpcServerPlugin) Init(ctx context.Context) error

func (*GrpcServerPlugin) Run

func (g *GrpcServerPlugin) Run(ctx context.Context) error

type GrpcServerPluginConf

type GrpcServerPluginConf struct {
	GrpcListen      string `yaml:"grpc_listen" json:"grpc_listen"`
	ServiceEndpoint string `yaml:"service_endpoint" json:"service_endpoint"`
}

type GrpcService

type GrpcService struct {
	Metadata grpc_service.Metadata
	Impl     any
}

type HttpServerPlugin

type HttpServerPlugin struct {
	application.Plugin `yaml:"-" json:"-"`
	// contains filtered or unexported fields
}

func (*HttpServerPlugin) Config

func (h *HttpServerPlugin) Config(_ context.Context, conf []byte) error

func (*HttpServerPlugin) Init

func (h *HttpServerPlugin) Init(ctx context.Context) error

func (*HttpServerPlugin) Run

func (h *HttpServerPlugin) Run(ctx context.Context) error

type HttpServerPluginConf

type HttpServerPluginConf struct {
	Endpoint string `json:"http_endpoint" yaml:"http_endpoint"`
}

Jump to

Keyboard shortcuts

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