helpers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientTLSConfig

func ClientTLSConfig(flagOpts TLS) (config *tls.Config, err error)

func Config

func Config(cmd *cobra.Command) (*viper.Viper, error)

func Graph

func Graph(ctx context.Context, cfg *viper.Viper) (syncd map[string]graph.Graph, closer func(context.Context) error, err error)

func Logger

func Logger(writer io.Writer, cfg *viper.Viper) (*zap.Logger, error)

func OverridePostgresGraphFactory

func OverridePostgresGraphFactory(factory PostgresGraphFactory)

func ResetPostgresGraphFactory

func ResetPostgresGraphFactory()

func ServerTLSConfig

func ServerTLSConfig(cfg *viper.Viper) (config *tls.Config, err error)

Types

type Error

type Error interface {
	error
	Code() int
}

func NewError

func NewError(msg string, exitCode int) Error

func WrapError

func WrapError(err error, exitCode int) Error

type GraphConfig

type GraphConfig struct {
	Source struct {
		Postgres *struct {
			Connection StringValue
			SyncTable  struct {
				Name string
			}
			SequenceTable struct {
				Name string
			}
		}
	}
	Models map[string]GraphModel
}

func (*GraphConfig) PostgreSQL

func (c *GraphConfig) PostgreSQL(ctx context.Context) (graph.Factory, error)

func (*GraphConfig) Validate

func (c *GraphConfig) Validate() error

type GraphModel

type GraphModel struct {
	Table    string
	Key      string
	Version  string
	Sequence string
	ChildKey string
	Priority string
	IsSet    bool
	Children map[string]GraphModel
}

func (*GraphModel) GenerateModel

func (m *GraphModel) GenerateModel(name string, model *graph.Model) error

type MetricServerContext

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

func (*MetricServerContext) Error

func (msc *MetricServerContext) Error() error

func (*MetricServerContext) Stop

func (msc *MetricServerContext) Stop()

type Model

type Model struct {
	Filters []graph.Filter
}

type ModelMap

type ModelMap map[string]Model

func Models

func Models(cfg *viper.Viper) (ModelMap, error)

type PostgresGraphFactory

type PostgresGraphFactory func(ctx context.Context, config postgres.ConnectionConfig) (graph.Factory, error)

type Probes

type Probes struct {
	Registry *prometheus.Registry
	// contains filtered or unexported fields
}

func Health

func Health() (*Probes, error)

func (*Probes) Http

func (mc *Probes) Http() *http.ServeMux

func (*Probes) NotReady

func (mc *Probes) NotReady()

func (*Probes) Ready

func (mc *Probes) Ready()

func (*Probes) Serve

func (mc *Probes) Serve(addr string) *MetricServerContext

type StringValue

type StringValue struct {
	Value   string
	FromEnv string
}

func (*StringValue) GetValue

func (sv *StringValue) GetValue() string

type TLS

type TLS struct {
	CA              []string
	CertificateFile string `mapstructure:"crt"`
	KeyFile         string `mapstructure:"key"`
}

Jump to

Keyboard shortcuts

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