server

package
v0.0.0-...-2e58fa2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

README

Server

The server package provides an http server that can be configured with serving certs and a CA for various client cert validation options.

We should update it so the serving cert / private key along with the CAs used for client cert validation can be rotated at runtime ("hitless certificate rotation").

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMeter

func NewMeter(provider metric.MeterProvider) (metric.Meter, error)

func NewMeterProvider

func NewMeterProvider(s *Server) (metric.MeterProvider, error)

Types

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Options *Options

	GrpcConfig *grpc.Config
	HttpConfig *http.Config
}

func NewConfig

func NewConfig(o *Options) *Config

func (*Config) Complete

func (c *Config) Complete() (CompletedConfig, []error)

type Options

type Options struct {
	Id        string `mapstructure:"id"`
	Name      string `mapstructure:"name"`
	PublicUrl string `mapstructure:"public_url"`

	GrpcOptions *grpc.Options `mapstructure:"grpc"`
	HttpOptions *http.Options `mapstructure:"http"`
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet, prefix string)

func (*Options) Complete

func (o *Options) Complete() []error

func (*Options) Validate

func (o *Options) Validate() []error

type Server

type Server struct {
	Id   string
	Name string

	HttpServer *khttp.Server
	GrpcServer *kgrpc.Server
	App        *kratos.App

	Logger log.Logger
}

func New

func New(c CompletedConfig, authn middleware.Middleware, logger log.Logger) (*Server, error)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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