conf

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Path string
	Port int
)

Functions

func LoadEnv added in v1.0.6

func LoadEnv(cli *cli.Context) error

func NewEnvExpandedReader

func NewEnvExpandedReader(origin io.Reader) io.Reader

Types

type Config

type Config struct {
	Name        string      `yaml:"name"`
	BaseURL     string      `yaml:"baseUrl"`
	JWT         JWT         `yaml:"jwt"`
	Transports  Transports  `yaml:"transports"`
	Persistence Persistence `yaml:"persistence"`
	EventBus    EventBus    `yaml:"eventBus"`
	Providers   Providers   `yaml:"providers"`
	Test        Test        `yaml:"test"`
}

func LoadConfig

func LoadConfig() (*Config, error)

type Consumer

type Consumer struct {
	Name   string
	Stream string
	Config json.RawMessage
}

func (*Consumer) UnmarshalYAML

func (c *Consumer) UnmarshalYAML(value *yaml.Node) error

type EventBus

type EventBus struct {
	Provider TransportProvider
	Users    Users
}

func (*EventBus) UnmarshalYAML

func (e *EventBus) UnmarshalYAML(value *yaml.Node) error

type Health added in v1.0.6

type Health struct {
	Enabled bool   `yaml:"enabled"`
	Path    string `yaml:"path"`
}

type Instance added in v1.0.6

type Instance struct {
	Scheme string `yaml:"scheme"`
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
	Health Health `yaml:"health"`
}

func (*Instance) URL added in v1.0.6

func (i *Instance) URL() string

type JWT

type JWT struct {
	Secret  string
	Timeout time.Duration
	Refresh struct {
		Enabled bool
		Maximum time.Duration
	}
}

func (*JWT) UnmarshalYAML

func (cfg *JWT) UnmarshalYAML(value *yaml.Node) error

type LoadBalancing added in v1.0.6

type LoadBalancing struct {
	Enabled bool `yaml:"enabled"`
}

type Persistence added in v1.0.3

type Persistence struct {
	Driver   PersistenceDriver
	Name     string
	Host     string
	Port     int
	Username string
	Password string
	InMem    bool
}

func (*Persistence) UnmarshalYAML added in v1.0.3

func (p *Persistence) UnmarshalYAML(value *yaml.Node) error

type PersistenceDriver added in v1.0.3

type PersistenceDriver int
const (
	SQLite PersistenceDriver = iota
	BadgerDB
	InMem
)

func ParsePersistenceDriver added in v1.0.3

func ParsePersistenceDriver(driver string) (PersistenceDriver, error)

func (PersistenceDriver) String added in v1.0.3

func (driver PersistenceDriver) String() string

type Providers

type Providers struct {
	Google struct {
		Client struct {
			ID     string
			Secret string
		}
	}
}

type RegisterHTTP added in v1.0.6

type RegisterHTTP struct {
	Enabled  bool
	Internal Instance
	External *Instance
}

func (*RegisterHTTP) UnmarshalYAML added in v1.0.6

func (r *RegisterHTTP) UnmarshalYAML(value *yaml.Node) error

type RegisterNATS added in v1.0.6

type RegisterNATS struct {
	Enabled   bool      `yaml:"enabled"`
	Internal  Instance  `yaml:"internal"`
	External  *Instance `yaml:"external"`
	ReqPrefix string    `yaml:"reqPrefix"`
}

type Stream

type Stream struct {
	Name   string
	Config json.RawMessage
}

func (*Stream) UnmarshalYAML

func (s *Stream) UnmarshalYAML(value *yaml.Node) error

type Test

type Test struct {
	Token string
}

type TransportProvider

type TransportProvider int
const NATS TransportProvider = iota

func ParseTransportProvider

func ParseTransportProvider(provider string) (TransportProvider, error)

func (TransportProvider) String added in v1.0.3

func (p TransportProvider) String() string

type Transports added in v1.0.6

type Transports struct {
	HTTP          RegisterHTTP  `yaml:"http"`
	NATS          RegisterNATS  `yaml:"nats"`
	LoadBalancing LoadBalancing `yaml:"loadBalancing"`
}

type Users

type Users struct {
	Stream   Stream
	Consumer Consumer
}

Jump to

Keyboard shortcuts

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