server

package
v0.4.30 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: BSD-3-Clause-Clear Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(f ...StartOptions) error

Types

type StartConfig

type StartConfig struct {
	ConfigKey             string
	ConfigFile            string
	WaitForShutdownSignal bool
	PublicRoutes          []string
	// contains filtered or unexported fields
}

type StartOptions

type StartOptions func(StartConfig) StartConfig

func WithBuiltinAuthZPolicy added in v0.4.30

func WithBuiltinAuthZPolicy(policy string) StartOptions

WithAuthZPolicy option sets the default casbin policy to be used. Example:

  opentdf.WithAuthZPolicy(strings.Join([]string{
	   "p, role:admin, pep*, *, allow",
	   "p, role:standard, pep*, read, allow",
	 }, "\n")),

func WithCasbinAdapter added in v0.4.30

func WithCasbinAdapter(adapter persist.Adapter) StartOptions

WithCasbinAdapter option sets the casbin adapter to be used for the casbin enforcer.

func WithConfigFile

func WithConfigFile(file string) StartOptions

WithConfigFile option sets the configuration file path.

func WithConfigKey

func WithConfigKey(key string) StartOptions

WithConfigKey option sets the viper configuration key(filename).

func WithConfigName deprecated

func WithConfigName(name string) StartOptions

Deprecated: Use WithConfigKey WithConfigName option sets the configuration name.

func WithCoreServices added in v0.4.18

func WithCoreServices(services ...serviceregistry.IService) StartOptions

WithCoreServices option adds additional core services to the platform It takes a variadic parameter of type serviceregistry.Registration, which represents the core services to be added.

func WithPublicRoutes

func WithPublicRoutes(routes []string) StartOptions

WithPublicRoutes option sets the public routes for the server. It allows bypassing the authorization middleware for the specified routes. *** This should be used with caution as it can expose sensitive data. ***

func WithServices added in v0.4.18

func WithServices(services ...serviceregistry.IService) StartOptions

WithServices option adds additional services to the platform. This will set the mode for these services to the namespace name. It takes a variadic parameter of type serviceregistry.Registration, which represents the services to be added.

func WithWaitForShutdownSignal

func WithWaitForShutdownSignal() StartOptions

WithWaitForShutdownSignal option allows the server to wait for a shutdown signal before exiting.

Jump to

Keyboard shortcuts

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