config

package
v1.0.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(sOpts *service.Options) (err error)

func SetOptions

func SetOptions(sOpts *service.Options) (err error)

Types

type Auth

type Auth struct {
	Name            string          `json:"name" sc:"name"`
	Enable          bool            `json:"enable" sc:"enable"`
	Namespace       string          `json:"namespace" sc:"namespace"`
	AuthCredentials authCredentials `json:"authCredentials" sc:"authCredentials"`
	PublicKey       string          `json:"publicKey" sc:"public-key"`
	PrivateKey      string          `json:"privateKey" sc:"private-key"`
}

func (*Auth) Options

func (a *Auth) Options() []au.Option

type Broker

type Broker struct {
	Address string `json:"address" sc:"address"`
	Name    string `json:"name" sc:"name"`
}

func (*Broker) Options

func (b *Broker) Options() []br.Option

type Client

type Client struct {
	Name     string        `json:"name" sc:"name"`
	Protocol string        `json:"protocol" sc:"protocol"`
	Pool     pool          `json:"pool" sc:"pool"`
	Request  clientRequest `json:"request" sc:"request"`
}

func (*Client) Options

func (c *Client) Options() []cl.Option

type Config

type Config struct {
	HierarchyMerge bool `json:"hierarchyMerge" sc:"hierarchy-merge"`
	Storage        bool `json:"storage" sc:"storage"`
}

func (*Config) Options

func (c *Config) Options() []cfg.Option

type Logger

type Logger struct {
	Name  string `json:"name" sc:"name"`
	Level string `json:"level" sc:"level"`
	// todo support map settings
	// Fields          map[string]string `json:"fields" sc:"fields"`
	CallerSkipCount int            `json:"caller-skip-count" sc:"caller-skip-count"`
	Persistence     logPersistence `json:"persistence" sc:"persistence"`
}

func (*Logger) Options

func (l *Logger) Options() []lg.Option

type Registry

type Registry struct {
	Address string `json:"address" sc:"address"`
	Name    string `json:"name" sc:"name"`
}

func (*Registry) Options

func (r *Registry) Options() []reg.Option

type Selector

type Selector struct {
	Name string `json:"name" sc:"name"`
}

func (*Selector) Options

func (s *Selector) Options() []sel.Option

type Server

type Server struct {
	Address     string         `json:"address" sc:"address"`
	Advertise   string         `json:"advertise" sc:"advertise"`
	ID          string         `json:"id" sc:"id"`
	Metadata    metadata       `json:"metadata" sc:"metadata"`
	Name        string         `json:"name" sc:"name"`
	Protocol    string         `json:"protocol" sc:"protocol"`
	Version     string         `json:"version" sc:"version"`
	Registry    serverRegistry `json:"Registry" sc:"Registry"`
	EnableDebug bool           `json:"enableDebug" sc:"enable-debug"`
}

func (*Server) Options

func (s *Server) Options() []ser.Option

type Service

type Service struct {
	ID      string `json:"id" sc:"id"`
	Name    string `json:"name" sc:"name"`
	Address string `json:"address" sc:"address"`
	RPC     string `json:"rpc" sc:"rpc"`
	Web     Web    `json:"web" sc:"web"`
}

func (*Service) Options

func (s *Service) Options() serviceOpts

type StackConfig

type StackConfig struct {
	Stack struct {
		Includes  string    `json:"includes" sc:"includes"`
		Config    Config    `json:"config" sc:"config"`
		Registry  Registry  `json:"registry" sc:"registry"`
		Broker    Broker    `json:"broker" sc:"broker"`
		Client    Client    `json:"client" sc:"client"`
		Profile   string    `json:"profile" sc:"profile"`
		Runtime   string    `json:"runtime" sc:"runtime"`
		Server    Server    `json:"server" sc:"server"`
		Selector  Selector  `json:"selector" sc:"selector"`
		Transport Transport `json:"transport" sc:"transport"`
		Logger    Logger    `json:"logger" sc:"logger"`
		Auth      Auth      `json:"auth" sc:"auth"`
		Service   Service   `json:"service" sc:"service"`
	} `json:"stack" sc:"stack"`
}

type Transport

type Transport struct {
	Name    string `json:"name" sc:"name"`
	Address string `json:"address" sc:"address"`
}

func (*Transport) Options

func (t *Transport) Options() []tra.Option

type Web

type Web struct {
	Enable   bool   `json:"enable" sc:"enable"`
	RootPath string `json:"rootPath" sc:"root-path"`
	Static   struct {
		Route string `json:"route" sc:"route"`
		Dir   string `json:"dir" sc:"dir"`
	} `json:"static" sc:"static"`
}

Jump to

Keyboard shortcuts

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