Documentation
¶
Index ¶
- Constants
- Variables
- func ForceNewEntity() (types.Entity, error)
- type BBolter
- func (s *BBolter) CleanCompactStats() error
- func (s *BBolter) CompactStats() (es map[string]types.StatEntity, err error)
- func (s *BBolter) CreateCompactStats(id string, createAt time.Time, p types.StatPayload) error
- func (s *BBolter) CreateEndpoint(p types.EndpointPayload) (types.EndpointEntity, error)
- func (s *BBolter) CreateRequest(p types.RequestPayload) (types.RequestEntity, error)
- func (s *BBolter) CreateSchedule(p types.SchedulePayload) (types.ScheduleEntity, error)
- func (s *BBolter) Endpoint(id string) (e types.EndpointEntity, err error)
- func (s *BBolter) Endpoints() (es map[string]types.EndpointEntity, err error)
- func (s *BBolter) GetItem(bucket []byte, id string, j interface{}) error
- func (s *BBolter) NewEntity() types.Entity
- func (s *BBolter) PublishChange(kind PubType, variant PubVerb, contents interface{})
- func (s *BBolter) Request(id string) (e types.RequestEntity, err error)
- func (s *BBolter) Requests() (es map[string]types.RequestEntity, err error)
- func (s *BBolter) Schedule(id string) (e types.ScheduleEntity, err error)
- func (s *BBolter) Schedules() (es map[string]types.ScheduleEntity, err error)
- func (s *BBolter) Size() (int64, error)
- func (s *BBolter) SoftDeleteEndpoint(id string) (j types.EndpointEntity, err error)
- func (s *BBolter) SoftDeleteRequest(id string) (j types.RequestEntity, err error)
- func (s *BBolter) SoftDeleteSchedule(id string) (j types.ScheduleEntity, err error)
- func (s *BBolter) UpdateCompactStats(id string, createdAt time.Time, p types.StatPayload) error
- func (s *BBolter) UpdateEndpoint(id string, p types.EndpointPayload) (types.EndpointEntity, error)
- func (s *BBolter) UpdateRequest(id string, p types.RequestPayload) (types.RequestEntity, error)
- func (s *BBolter) UpdateSchedule(id string, p types.Schedule) (types.ScheduleEntity, error)
- type Gob
- type Marshaller
- type PubSubPublisher
- type PubType
- type PubVerb
Constants ¶
View Source
const ( PubTypeEndpoint PubType = "endpoint" PubTypeRequest PubType = "request" PubTypeSchedule PubType = "schedule" PubTypeStat PubType = "stat" PubVerbCreate PubVerb = "create" PubVerbUpdate PubVerb = "update" // Marks the item as deleted in the database, but does not delete it PubVerbSoftDelete PubVerb = "soft-delete" // Removes all items permanently PubVerbClean PubVerb = "clean" )
Variables ¶
View Source
var ( ErrMissingIdArg = errors.New("Missing id as argument") ErrNotFound = errors.New("Not found") )
View Source
var ( BucketEndpoints = []byte("endpoints") BucketRequests = []byte("requests") BucketSchedules = []byte("schedules") BucketStats = []byte("stats") )
Functions ¶
func ForceNewEntity ¶
Returns an entity for use by database, with id set and createdAt to current time. It is guaranteeed to be created correctly, if if it errors. The error should be logged.
Types ¶
type BBolter ¶
type BBolter struct { *bolt.DB Marshaller // contains filtered or unexported fields }
func (*BBolter) CleanCompactStats ¶
func (*BBolter) CompactStats ¶
func (s *BBolter) CompactStats() (es map[string]types.StatEntity, err error)
func (*BBolter) CreateCompactStats ¶
func (*BBolter) CreateEndpoint ¶
func (s *BBolter) CreateEndpoint(p types.EndpointPayload) (types.EndpointEntity, error)
func (*BBolter) CreateRequest ¶
func (s *BBolter) CreateRequest(p types.RequestPayload) (types.RequestEntity, error)
func (*BBolter) CreateSchedule ¶
func (s *BBolter) CreateSchedule(p types.SchedulePayload) (types.ScheduleEntity, error)
func (*BBolter) Endpoint ¶
func (s *BBolter) Endpoint(id string) (e types.EndpointEntity, err error)
func (*BBolter) Endpoints ¶
func (s *BBolter) Endpoints() (es map[string]types.EndpointEntity, err error)
func (*BBolter) PublishChange ¶ added in v0.3.0
func (*BBolter) Requests ¶
func (s *BBolter) Requests() (es map[string]types.RequestEntity, err error)
func (*BBolter) Schedule ¶
func (s *BBolter) Schedule(id string) (e types.ScheduleEntity, err error)
func (*BBolter) Schedules ¶
func (s *BBolter) Schedules() (es map[string]types.ScheduleEntity, err error)
func (*BBolter) SoftDeleteEndpoint ¶
func (s *BBolter) SoftDeleteEndpoint(id string) (j types.EndpointEntity, err error)
func (*BBolter) SoftDeleteRequest ¶ added in v0.4.0
func (s *BBolter) SoftDeleteRequest(id string) (j types.RequestEntity, err error)
func (*BBolter) SoftDeleteSchedule ¶ added in v0.4.0
func (s *BBolter) SoftDeleteSchedule(id string) (j types.ScheduleEntity, err error)
func (*BBolter) UpdateCompactStats ¶
func (*BBolter) UpdateEndpoint ¶
func (s *BBolter) UpdateEndpoint(id string, p types.EndpointPayload) (types.EndpointEntity, error)
func (*BBolter) UpdateRequest ¶ added in v0.4.0
func (s *BBolter) UpdateRequest(id string, p types.RequestPayload) (types.RequestEntity, error)
func (*BBolter) UpdateSchedule ¶
type Marshaller ¶
type PubSubPublisher ¶ added in v0.3.0
type PubSubPublisher interface {
Publish(kind, variant string, contents interface{})
}
Click to show internal directories.
Click to hide internal directories.