policy

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.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 Duration added in v2.0.13

type Duration time.Duration

func (Duration) MarshalJSON added in v2.0.13

func (p Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalText added in v2.0.13

func (p Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalJSON added in v2.0.13

func (p *Duration) UnmarshalJSON(data []byte) error

func (*Duration) UnmarshalText added in v2.0.13

func (p *Duration) UnmarshalText(data []byte) error

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewManager

func NewManager(configFile string, logger zLogger.ZLogger) *Manager

func (*Manager) Get

func (m *Manager) Get(id string) (*Policy, bool)

func (*Manager) GetAll added in v2.0.13

func (m *Manager) GetAll() []*Policy

func (*Manager) SetAll added in v2.0.13

func (m *Manager) SetAll(policies []*Policy) error

func (*Manager) Start

func (m *Manager) Start(wg *sync.WaitGroup) error

func (*Manager) Stop

func (m *Manager) Stop()

type Policy

type Policy struct {
	Name   string   `json:"name" toml:"name" yaml:"name"`
	URIs   []string `json:"uris" toml:"uris" yaml:"uris"`
	DNS    []string `json:"dns" toml:"dns" yaml:"dns"`
	IPs    []string `json:"ips" toml:"ips" yaml:"ips"`
	MaxTTL Duration `json:"maxttl" toml:"maxttl" yaml:"maxttl" example:"48h"`
}

func NewPolicy

func NewPolicy(name string, uris []string, dns []string, ips []string, maxTTL time.Duration) *Policy

Jump to

Keyboard shortcuts

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