Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorService = "internal service error" ErrorUserPassRequired = "both user and pass are required" ErrorUserPassUnknown = "unknown user/pass combination" ErrorRequireEventID = "missing required event id" ErrorRequireDeviceID = "missing required device id" ErrorRequireUnlockCode = "missing required unlock code" ErrorEventNotFound = "event not found" ErrorEventExists = "event already exists" ErrorUnlockNotFound = "device / unlock code combination not found" ErrorInvalidQRParams = "QR Code can't be generated using provided parameters" ErrorQRGenerate = "QR Code generator failed" )
Frontend Service Error descriptions
View Source
const ServiceName = "frontend"
ServiceName of this service.
Variables ¶
View Source
var ( ErrService = errors.New(ErrorService) ErrUserPassRequired = errors.New(ErrorUserPassRequired) ErrUserPassUnknown = errors.New(ErrorUserPassUnknown) ErrRequireEventID = errors.New(ErrorRequireEventID) ErrRequireDeviceID = errors.New(ErrorRequireDeviceID) ErrRequireUnlockCode = errors.New(ErrorRequireUnlockCode) ErrEventNotFound = errors.New(ErrorEventNotFound) ErrEventExists = errors.New(ErrorEventExists) ErrUnlockNotFound = errors.New(ErrorUnlockNotFound) ErrInvalidQRParams = errors.New(ErrorInvalidQRParams) ErrQRGenerate = errors.New(ErrorQRGenerate) )
Frontend Service Errors
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID uuid.UUID `json:"id"` Name string `json:"name"` }
Event holds event details
type Service ¶
type Service interface { Login(ctx context.Context, user, pass string) (*Login, error) EventCreate(ctx context.Context, tenantID uuid.UUID, event Event) (*uuid.UUID, error) EventGet(ctx context.Context, tenantID, eventID uuid.UUID) (*Event, error) EventUpdate(ctx context.Context, tenantID uuid.UUID, event Event) error EventDelete(ctx context.Context, tenantID, eventID uuid.UUID) error EventList(ctx context.Context, tenantID uuid.UUID) ([]*Event, error) UnlockDevice(ctx context.Context, eventID, deviceID uuid.UUID, unlockCode string) (*Session, error) GenerateQR(ctx context.Context, eventID, deviceID uuid.UUID, unlockCode string) ([]byte, error) }
Service describes our Frontend service.
type Session ¶
type Session struct { EventID uuid.UUID `json:"event_id,omitempty"` EventCaption string `json:"event_caption,omitempty"` DeviceID uuid.UUID `json:"device_id,omitempty"` DeviceCaption string `json:"device_caption,omitempty"` Token string `json:"token,omitempty"` }
Session holds session details
Click to show internal directories.
Click to hide internal directories.