server

package
v0.0.0-...-be2ef80 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 32 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPC

func NewGRPC(ctx context.Context, config *Config) (*grpc.Server, error)

NewGRPC creates the gRPC server.

func StartGRPC

func StartGRPC(ctx context.Context, config *Config) error

StartGRPC starts the gRPC server

Types

type CerealConfig

type CerealConfig struct {
	Target string `mapstructure:"target"`
}

type Config

type Config struct {
	Host             string          `mapstructure:"host" toml:"host"`
	Port             int             `mapstructure:"port" toml:"port"`
	LicenseTokenPath string          `mapstructure:"license_token_path" toml:"license_token_path"`
	MigrationsPath   string          `mapstructure:"migrations_path" toml:"migrations_path"`
	PGURL            string          `mapstructure:"pg_url" toml:"pg_url"`
	Database         string          `mapstructure:"database" toml:"database"`
	TLSConfig        certs.TLSConfig `toml:"tls"`
	OptOutPath       string          `mapstructure:"opt_out_path" toml:"opt_out_path"`
	URL              string          `mapstructure:"url" toml:"url"`
	OptOut           string          `mapstructure:"opt_out" toml:"opt_out"`
	TelemetryEnabled bool
	ServiceCerts     *certs.ServiceCerts
	CerealConfig     CerealConfig `mapstructure:"cereal"`
	LicenseAudit     LicenseAudit `mapstructure:"license_audit"`
}

Config is the LicenseControlServer client and server configuration

func ConfigFromViper

func ConfigFromViper() (*Config, error)

ConfigFromViper marshals configuration from the LicenseControlServer servers configuration file that is parsed Viper into the Config struct.

func (Config) ListenAddress

func (c Config) ListenAddress() string

ListenAddress is the address where gRPC server will bind and listen

type LicenseAudit

type LicenseAudit struct {
	Url       string `mapstructure:"url" toml:"url"`
	Frequency string `mapstructure:"frequency" toml:"frequency"`
	Interval  int    `mapstructure:"interval" toml:"interval"`
}

type LicenseControlServer

type LicenseControlServer struct {
	TelemetryEnabled bool
	TelemetryURL     string
	// contains filtered or unexported fields
}

LicenseControlServer is our structure representing the gRPC server backend.

func NewLicenseControlServer

func NewLicenseControlServer(ctx context.Context, backend storage.CurrentBackend,
	licenseParser *keys.LicenseParser, config *Config) *LicenseControlServer

NewLicenseControlServer returns a new instance of our LicenseControlServer.

func (*LicenseControlServer) GetDeploymentID

GetDeploymentID fetches the deployment id from license control service

func (*LicenseControlServer) License

License returns the license information

func (*LicenseControlServer) Policy

Policy sends the constructed Policy. Currently we don't process any request input.

func (*LicenseControlServer) Status

Status returns the LicenseControlServer status information

func (*LicenseControlServer) Telemetry

Telemetry endpoint to return telemetry configuration

func (*LicenseControlServer) Update

Update updates the LicenseControlServer with the new license information

Jump to

Keyboard shortcuts

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