config

package
v0.0.0-...-98b9d28 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagFile = "f"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Proto *Proto
	DB    *DBConfig

	InMessages         map[string]*InMessage
	OutMessages        map[string]*OutMessage
	AutoMapOutMessages bool
}

Config is application configuration.

func New

func New(args []string, makeFS func(string) fs.FS) (*Config, error)

New initializes and returns a new Config.

type DBConfig

type DBConfig struct {
	Driver   string            `json:"driver"`
	Host     string            `json:"host"`
	Port     int               `json:"port"`
	Name     string            `json:"name"`
	UserName string            `json:"userName"`
	Password string            `json:"password"`
	Params   map[string]string `json:"params"`
	Query    string            `json:"query"`
}

DBConfig encapsulates database configuration.

type InMessage

type InMessage struct {
	Alias string
	Name  protoreflect.FullName
	// contains filtered or unexported fields
}

InMessage is configuration for "in" messages, that is, messages going to the database.

func (*InMessage) JSON

func (m *InMessage) JSON(args []string) (string, error)

JSON template.

type OutMessage

type OutMessage struct {
	Alias string
	Name  protoreflect.FullName

	Template *template.Template
	Props    map[string]struct{} // all dotProps defined in template
}

OutMessage is configuration for "out" messages, that is, messages coming from the database.

type Proto

type Proto struct {
	C             string `json:"c"`
	Dir           string `json:"dir"` // TODO: multiple dirs
	Deterministic bool   `json:"deterministic"`
}

Proto encapsulates protobuf-specific configuration.

Jump to

Keyboard shortcuts

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