config

package
v0.0.0-...-d8c3596 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func (*BasicAuth) Valid

func (a *BasicAuth) Valid() bool

Valid reports whether this basic authentication configuration is considered valid. Returns false if it is nil, or if the username or password is empty.

type Config

type Config struct {
	HTTP *HTTP       `yaml:"http"`
	Ntfy *Ntfy       `yaml:"ntfy"`
	Log  *zap.Config `yaml:"log"`
}

type Expression

type Expression struct {
	Text      string
	Evaluable gval.Evaluable
}

func (*Expression) UnmarshalText

func (e *Expression) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type HTTP

type HTTP struct {
	Addr string     `yaml:"addr"`
	Auth *BasicAuth `yaml:"auth"`
}

type Notification

type Notification struct {
	Topic     StringExpression  `yaml:"topic"`
	Priority  *StringExpression `yaml:"priority"`
	Tags      []*Tag            `yaml:"tags"`
	Templates *Templates        `yaml:"templates"`
}

type Ntfy

type Ntfy struct {
	BaseURL      string        `yaml:"baseurl"`
	Timeout      time.Duration `yaml:"timeout"`
	Auth         *BasicAuth    `yaml:"auth"`
	Notification Notification  `yaml:"notification"`
}

type StringExpression

type StringExpression struct {
	Text       string
	Expression *Expression
}

func (*StringExpression) UnmarshalText

func (e *StringExpression) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Tag

type Tag struct {
	Tag       string      `yaml:"tag"`
	Condition *Expression `yaml:"condition"`
}

type Template

type Template template.Template

func (*Template) UnmarshalText

func (t *Template) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

type Templates

type Templates struct {
	Title       *Template `yaml:"title"`
	Description *Template `yaml:"description"`
}

Jump to

Keyboard shortcuts

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