Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoEntryFound = errors.New("no entry found with this ID")
ErrNoEntryFound is returned when no entry to a id is found
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
OAuthProvider, OAuthID string
RemoteAddr string `json:",omitempty"`
DeletionURL string `json:",omitempty"`
Password []byte `json:",omitempty"`
Public EntryPublicData
}
Entry is the data set which is stored in the DB as JSON
type EntryPublicData ¶
type EntryPublicData struct { CreatedOn time.Time LastVisit, Expiration *time.Time `json:",omitempty"` VisitCount int URL string }
EntryPublicData is the public part of an entry
type Storage ¶
type Storage interface { GetEntryByID(string) (*Entry, error) GetVisitors(string) ([]Visitor, error) DeleteEntry(string) error IncreaseVisitCounter(string) error CreateEntry(Entry, string, string) error GetUserEntries(string) (map[string]Entry, error) RegisterVisitor(string, string, Visitor) error Close() error }
Storage is an interface which will be implmented by each storage e.g. bolt, sqlite
Click to show internal directories.
Click to hide internal directories.