services

package
v0.0.0-...-45ad404 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a cache service

func NewCache

func NewCache() (*Cache, error)

NewCache returns new cache service

func (*Cache) Middleware

func (cache *Cache) Middleware() echo.MiddlewareFunc

Middleware returns cache middleware

func (*Cache) Purge

func (cache *Cache) Purge(ctx context.Context, lastModified time.Time)

Purge purges cache

type Inventory

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

Inventory service

func NewInventory

func NewInventory(path string) (*Inventory, error)

NewInventory creates new inventory

func (*Inventory) AddUpdateListener

func (i *Inventory) AddUpdateListener(listener func(context.Context, time.Time))

func (*Inventory) Get

func (i *Inventory) Get(ctx context.Context, identifier string) *ansible.Host

Get one host by its identifier. Identifier could be: - host name - IP address - email - admin MXID

func (*Inventory) GetAll

func (i *Inventory) GetAll(ctx context.Context, group string) map[string]*ansible.Host

GetAll returns all known hosts

func (*Inventory) GetUpdatedAt

func (i *Inventory) GetUpdatedAt() time.Time

GetUpdatedAt returns the last update timestamp

type InventoryService

type InventoryService interface {
	GetUpdatedAt() time.Time
	Get(ctx context.Context, host string) *ansible.Host
	GetAll(ctx context.Context, group string) map[string]*ansible.Host
}

InventoryService interface

type ServiceDiscovery

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

ServiceDiscovery for Prometheus

func NewServiceDiscovery

func NewServiceDiscovery(inv InventoryService) *ServiceDiscovery

NewServiceDiscovery returns new prometheus service discovery service

func (*ServiceDiscovery) Get

func (sd *ServiceDiscovery) Get(ctx context.Context, identifier, job string, singleOnly bool) []*models.ServiceDiscovery

Get service discovery, if identifier is empty it will return sd for all customers hosts

func (*ServiceDiscovery) GetUpdatedAt

func (sd *ServiceDiscovery) GetUpdatedAt() time.Time

GetUpdatedAt returns the last updated at timestamp

Jump to

Keyboard shortcuts

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