server

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: BSD-3-Clause-Clear Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSConfig added in v0.4.1

type CORSConfig struct {
	// Enable CORS for the server (default: true)
	Enabled          bool     `yaml:"enabled" default:"true"`
	AllowedOrigins   []string `yaml:"allowedorigins"`
	AllowedMethods   []string `yaml:"allowedmethods"`
	AllowedHeaders   []string `yaml:"allowedheaders"`
	ExposedHeaders   []string `yaml:"exposedheaders"`
	AllowCredentials bool     `yaml:"allowcredentials" default:"true"`
	MaxAge           int      `yaml:"maxage" default:"3600"`
}

CORS Configuration for the server

type Config

type Config struct {
	Auth                    auth.Config     `yaml:"auth"`
	GRPC                    GRPCConfig      `yaml:"grpc"`
	CryptoProvider          security.Config `yaml:"cryptoProvider"`
	TLS                     TLSConfig       `yaml:"tls"`
	CORS                    CORSConfig      `yaml:"cors"`
	WellKnownConfigRegister func(namespace string, config any) error
	// Port to listen on
	Port int    `yaml:"port" default:"8080"`
	Host string `yaml:"host,omitempty"`
}

Configurations for the server

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type GRPCConfig

type GRPCConfig struct {
	// Enable reflection for grpc server (default: true)
	ReflectionEnabled bool `yaml:"reflectionEnabled" default:"true"`
}

GRPC Server specific configurations

type OpenTDFServer

type OpenTDFServer struct {
	Mux            *runtime.ServeMux
	HTTPServer     *http.Server
	GRPCServer     *grpc.Server
	GRPCInProcess  *inProcessServer
	CryptoProvider security.CryptoProvider
}

func NewOpenTDFServer

func NewOpenTDFServer(config Config) (*OpenTDFServer, error)

func (OpenTDFServer) Start

func (s OpenTDFServer) Start()

func (OpenTDFServer) Stop

func (s OpenTDFServer) Stop()

type TLSConfig

type TLSConfig struct {
	// Enable TLS for the server (default: false)
	Enabled bool `yaml:"enabled" default:"false"`
	// Path to the certificate file
	Cert string `yaml:"cert"`
	// Path to the key file
	Key string `yaml:"key"`
}

TLS Configuration for the server

Jump to

Keyboard shortcuts

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