model

package
v0.0.0-...-16240d6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Resource string `json:"resource"`
	Label    string `json:"label"`
}

type Model

type Model interface {
	Add(ctx context.Context, s Server) error
	GetAll(ctx context.Context, d time.Duration) ([]Server, error)
	Clear(ctx context.Context) error
	GetDepending(ctx context.Context, ident string, depth int, since time.Duration) ([]Server, error)
	GetDependencies(ctx context.Context, ident string, depth int, since time.Duration) ([]Server, error)
}

func NewMemoryModel

func NewMemoryModel() Model

type Server

type Server struct {
	Hostname     string       `json:"hostname"`
	Key          string       `json:"key"`
	IPs          []string     `json:"ips"`
	Dependencies []Dependency `json:"dependencies"`
	LastUpdate   time.Time    `json:"lastUpdate"`
}

func (Server) IsIdentifiedBy

func (s Server) IsIdentifiedBy(id string) bool

Jump to

Keyboard shortcuts

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