config

package
v0.0.0-...-071f0a0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllConfig

type AllConfig struct {
	RPC struct {
		Listen string `mapstructure:"listen"`
	} `mapstructure:"rpc"`
	Reload struct {
		Enabled  bool     `mapstructure:"enabled"`
		Interval string   `mapstructure:"interval"`
		Patterns []string `mapstructure:"patterns"`
		Services struct {
			HTTP struct {
				Recursive bool     `mapstructure:"recursive"`
				Ignore    []string `mapstructure:"ignore"`
				Patterns  []string `mapstructure:"patterns"`
				Dirs      []string `mapstructure:"dirs"`
			} `mapstructure:"http"`
			Jobs struct {
				Recursive bool     `mapstructure:"recursive"`
				Ignore    []string `mapstructure:"ignore"`
				Dirs      []string `mapstructure:"dirs"`
			} `mapstructure:"jobs"`
			RPC struct {
				Recursive bool     `mapstructure:"recursive"`
				Patterns  []string `mapstructure:"patterns"`
				Dirs      []string `mapstructure:"dirs"`
			} `mapstructure:"rpc"`
		} `mapstructure:"services"`
	} `mapstructure:"reload"`
	Logs struct {
		Mode  string `mapstructure:"mode"`
		Level string `mapstructure:"level"`
	} `mapstructure:"logs"`
}

type Configurer

type Configurer interface {
	GracefulTimeout() time.Duration
	Unmarshal(out any) error
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if config section exists.
	Has(name string) bool
}

type Foo

type Foo struct {
	// contains filtered or unexported fields
}

func (*Foo) Init

func (f *Foo) Init(p Configurer) error

func (*Foo) Serve

func (f *Foo) Serve() chan error

func (*Foo) Stop

func (f *Foo) Stop(context.Context) error

type Foo2

type Foo2 struct {
	// contains filtered or unexported fields
}

func (*Foo2) Init

func (f *Foo2) Init(p Configurer) error

func (*Foo2) Serve

func (f *Foo2) Serve() chan error

func (*Foo2) Stop

func (f *Foo2) Stop(context.Context) error

type Foo3

type Foo3 struct {
	// contains filtered or unexported fields
}

func (*Foo3) Init

func (f *Foo3) Init(p Configurer) error

func (*Foo3) Serve

func (f *Foo3) Serve() chan error

func (*Foo3) Stop

func (f *Foo3) Stop(context.Context) error

type Foo4

type Foo4 struct {
	// contains filtered or unexported fields
}

func (*Foo4) Init

func (f *Foo4) Init(p Configurer) error

func (*Foo4) Serve

func (f *Foo4) Serve() chan error

func (*Foo4) Stop

func (f *Foo4) Stop(context.Context) error

type Foo5

type Foo5 struct {
	// contains filtered or unexported fields
}

func (*Foo5) Init

func (f *Foo5) Init(p Configurer) error

func (*Foo5) Serve

func (f *Foo5) Serve() chan error

func (*Foo5) Stop

func (f *Foo5) Stop(context.Context) error

type ReloadConfig

type ReloadConfig struct {
	Interval time.Duration
	Patterns []string
	Services map[string]ServiceConfig
}

ReloadConfig is a Reload configuration point.

type ServiceConfig

type ServiceConfig struct {
	Enabled   bool
	Recursive bool
	Patterns  []string
	Dirs      []string
	Ignore    []string
}

Jump to

Keyboard shortcuts

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