httpsd

package
v0.0.0-...-009cb35 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSet

func NewSet(values []Target) *set

Types

type Target

type Target struct {
	ID   uint64 `json:"id"`
	Addr string `json:"addr"`
}

type TargetGroup

type TargetGroup struct {
	ID      uint64                 `json:"id"`
	Targets []Target               `json:"targets"`
	Labels  map[string]interface{} `json:"labels"`
}

type TargetStore

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

func New

func New(db *bolt.DB) *TargetStore

New create a new HTTP service discovery

func (*TargetStore) CreateTargetGroup

func (ts *TargetStore) CreateTargetGroup(tg *TargetGroup) error

CreateTargetGroup creates a new target group, returns error if target group couldn't be created

func (*TargetStore) DeleteLabel

func (ts *TargetStore) DeleteLabel(tgID uint64, label_key string) error

func (*TargetStore) DeleteTarget

func (ts *TargetStore) DeleteTarget(tgID uint64, tID uint64) error

DeleteTarget deletes a target from targets of a target group, returns error if target group doesn't exist

func (*TargetStore) DeleteTargetGroup

func (ts *TargetStore) DeleteTargetGroup(id uint64) error

DeleteTarget deletes a target from targets of a target group, returns error if target group doesn't exist

func (*TargetStore) GetAllTargetGroups

func (ts *TargetStore) GetAllTargetGroups() ([]TargetGroup, error)

GetAllTargets returns a list of all target groups

func (*TargetStore) GetTargetGroup

func (ts *TargetStore) GetTargetGroup(id uint64) (*TargetGroup, error)

GetTargetGroup returns a target group with ID, returns error if target group doesn't exist

func (*TargetStore) IPInTargetList

func (ts *TargetStore) IPInTargetList(bkt *bolt.Bucket, ip string) bool

func (*TargetStore) UpdateTargetGroup

func (ts *TargetStore) UpdateTargetGroup(tg *TargetGroup) error

UpdateTarget updates port of a target, returns error if target group doesn't exist

Jump to

Keyboard shortcuts

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