endpoint

package
v0.0.0-...-270f78c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Zlib Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BucketName represents the name of the bucket where this service stores data.
	BucketName = "endpoints"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service represents a service for managing environment(endpoint) data.

func NewService

func NewService(connection portainer.Connection) (*Service, error)

NewService creates a new instance of a service.

func (*Service) BucketName

func (service *Service) BucketName() string

func (*Service) Create

func (service *Service) Create(endpoint *portainer.Endpoint) error

CreateEndpoint assign an ID to a new environment(endpoint) and saves it.

func (*Service) DeleteEndpoint

func (service *Service) DeleteEndpoint(ID portainer.EndpointID) error

DeleteEndpoint deletes an environment(endpoint).

func (*Service) Endpoint

func (service *Service) Endpoint(ID portainer.EndpointID) (*portainer.Endpoint, error)

Endpoint returns an environment(endpoint) by ID.

func (*Service) EndpointIDByEdgeID

func (service *Service) EndpointIDByEdgeID(edgeID string) (portainer.EndpointID, bool)

EndpointIDByEdgeID returns the EndpointID from the given EdgeID using an in-memory index

func (*Service) Endpoints

func (service *Service) Endpoints() ([]portainer.Endpoint, error)

Endpoints return an array containing all the environments(endpoints).

func (*Service) GetNextIdentifier

func (service *Service) GetNextIdentifier() int

GetNextIdentifier returns the next identifier for an environment(endpoint).

func (*Service) Heartbeat

func (service *Service) Heartbeat(endpointID portainer.EndpointID) (int64, bool)

func (*Service) UpdateEndpoint

func (service *Service) UpdateEndpoint(ID portainer.EndpointID, endpoint *portainer.Endpoint) error

UpdateEndpoint updates an environment(endpoint).

func (*Service) UpdateHeartbeat

func (service *Service) UpdateHeartbeat(endpointID portainer.EndpointID)

Jump to

Keyboard shortcuts

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