options

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package options contains flags and options for initializing an apiserver

Index

Constants

View Source
const (
	// UserAgent is the userAgent name when starting onex-usercenter server.
	UserAgent = "onex-usercenter"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerOptions

type ServerOptions struct {
	// GenericOptions *genericoptions.Options       `json:"server"   mapstructure:"server"`
	// gRPC options for configuring gRPC related options.
	GRPCOptions *genericoptions.GRPCOptions `json:"grpc" mapstructure:"grpc"`
	// HTTP options for configuring HTTP related options.
	HTTPOptions *genericoptions.HTTPOptions `json:"http" mapstructure:"http"`
	// TLS options for configuring TLS related options.
	TLSOptions *genericoptions.TLSOptions `json:"tls" mapstructure:"tls"`
	// MySQL options for configuring MySQL database related options.
	MySQLOptions *genericoptions.MySQLOptions `json:"mysql" mapstructure:"mysql"`
	// Redis options for configuring Redis related options.
	RedisOptions *genericoptions.RedisOptions `json:"redis" mapstructure:"redis"`
	// Etcd options for configuring Etcd related options.
	EtcdOptions *genericoptions.EtcdOptions `json:"etcd" mapstructure:"etcd"`
	// Kafka options for configuring Kafka related options.
	KafkaOptions *genericoptions.KafkaOptions `json:"kafka" mapstructure:"kafka"`
	// Jaeger options for configuring Jaeger related options.
	JaegerOptions *genericoptions.JaegerOptions `json:"jaeger" mapstructure:"jaeger"`
	// Consul options for configuring Consul related options.
	ConsulOptions *genericoptions.ConsulOptions `json:"consul" mapstructure:"consul"`
	// JWT options for configuring JWT related options.
	JWTOptions *genericoptions.JWTOptions `json:"jwt" mapstructure:"jwt"`
	// Metrics options for configuring metric related options.
	Metrics *genericoptions.MetricsOptions `json:"metrics" mapstructure:"metrics"`
	// TODO: add `mapstructure` tag for FeatureGates
	// A map of string to boolean values representing feature gates for enabling or disabling specific features.
	FeatureGates map[string]bool `json:"feature-gates"`
	// Log options for configuring log related options.
	Log *log.Options `json:"log" mapstructure:"log"`
}

ServerOptions contains the configuration options for the server.

func NewServerOptions

func NewServerOptions() *ServerOptions

NewServerOptions creates a ServerOptions instance with default values.

func (*ServerOptions) Complete

func (o *ServerOptions) Complete() error

Complete completes all the required options.

func (*ServerOptions) Config

func (o *ServerOptions) Config() (*usercenter.Config, error)

Config builds an usercenter.Config based on ServerOptions.

func (*ServerOptions) Flags

func (o *ServerOptions) Flags() (fss cliflag.NamedFlagSets)

Flags returns flags for a specific server by section name.

func (*ServerOptions) Validate

func (o *ServerOptions) Validate() error

Validate checks whether the options in ServerOptions are valid.

Jump to

Keyboard shortcuts

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