Documentation ¶
Index ¶
- Constants
- type Service
- func (service *Service) BatchUpdateEndpoints(endpoints ...model.Endpoint) error
- func (service *Service) CreateDatabase() (*bolt.Bucket, error)
- func (service *Service) CreateEndpoint(endpoint *model.Endpoint) error
- func (service *Service) DeleteEndpoint(ID int) error
- func (service *Service) Endpoint(ID int) (*model.Endpoint, error)
- func (service *Service) Endpoints() ([]model.Endpoint, error)
- func (service *Service) GetNextIdentifier() int
- func (service *Service) Synchronize(toCreate, toUpdate, toDelete []*model.Endpoint) error
- func (service *Service) TruncateDatabase() error
- func (service *Service) UpdateEndpoint(ID int, endpoint *model.Endpoint) error
Constants ¶
View Source
const (
// BucketName represents the name of the bucket where this service stores data.
BucketName = "endpoint"
)
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 endpoint data.
func NewService ¶
NewService creates a new instance of a service.
func (*Service) BatchUpdateEndpoints ¶
BatchUpdateEndpoints ...
func (*Service) CreateDatabase ¶ added in v0.0.4
CreateDatabase returns the next identifier for an endpoint.
func (*Service) CreateEndpoint ¶
CreateEndpoint assign an ID to a new endpoint and saves it.
func (*Service) DeleteEndpoint ¶
DeleteEndpoint deletes an endpoint.
func (*Service) GetNextIdentifier ¶
GetNextIdentifier returns the next identifier for an endpoint.
func (*Service) Synchronize ¶
Synchronize creates, updates and deletes endpoints inside a single transaction.
func (*Service) TruncateDatabase ¶ added in v0.0.4
TruncateDatabase delete all data
Click to show internal directories.
Click to hide internal directories.