Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerStopped       = errors.New("perm: the server has been stopped")
	ErrServerFailedToStart = errors.New("perm: the server failed to start")
)

Functions

This section is empty.

Types

type Server

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

func NewServer

func NewServer(opts ...ServerOption) *Server

func (*Server) GracefulStop

func (s *Server) GracefulStop()

func (*Server) Serve

func (s *Server) Serve(listener net.Listener) error

func (*Server) Stop

func (s *Server) Stop()

type ServerOption

type ServerOption func(*serverConfig)

func WithDBConn

func WithDBConn(conn *sqlx.DB) ServerOption

func WithLogger

func WithLogger(logger logx.Logger) ServerOption

func WithMaxConnectionIdle

func WithMaxConnectionIdle(duration time.Duration) ServerOption

func WithOIDCProvider

func WithOIDCProvider(provider oidcx.Provider) ServerOption

func WithSecurityLogger

func WithSecurityLogger(logger logx.SecurityLogger) ServerOption

func WithStatter

func WithStatter(statter metrics.Statter) ServerOption

func WithTLSConfig

func WithTLSConfig(config *tls.Config) ServerOption

Directories

Path Synopsis
internal
repos/reposfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
rpc