conf

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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"`
	Persistent Persistent `yaml:"persistent"`
	EventBus   EventBus   `yaml:"eventBus"`
	Providers  Providers  `yaml:"providers"`
	Test       Test       `yaml:"test"`
}

func LoadConfig

func LoadConfig(path string) (*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
	Host     string
	Port     int
	Users    Users
}

func (*EventBus) UnmarshalYAML

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

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 Persistent

type Persistent struct {
	Driver   PersistentDriver
	Name     string
	Host     string
	Port     int
	Username string
	Password string
	InMem    bool
}

func (*Persistent) UnmarshalYAML

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

type PersistentDriver

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

func ParsePersistentDriver

func ParsePersistentDriver(driver string) (PersistentDriver, error)

type Providers

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

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)

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