Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateEmail(v *validator.Validator, email string)
- func ValidateEntry(v *validator.Validator, item *Item)
- func ValidateFilters(v *validator.Validator, f Filters)
- func ValidatePasswordPlaintext(v *validator.Validator, password string)
- func ValidateTokenPlaintext(v *validator.Validator, tokenPlaintext string)
- func ValidateURL(v *validator.Validator, surl, urlType string)
- func ValidateUser(v *validator.Validator, user *User)
- type Article
- type ArticleModel
- type Filters
- type Item
- type ItemID
- type ItemMedia
- type ItemMetadata
- type ItemModel
- type MediaType
- type Models
- type Token
- type TokenModel
- type User
- type UserID
- type UserModel
Constants ¶
View Source
const ( ScopeActivation = "activation" ScopeAuthentication = "authentication" )
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("record not found") ErrNotOwned = errors.New("not owned") ErrDuplicateURL = errors.New("url already exists in another entry") ErrDuplicateTagInEntry = errors.New("tag already exists in entry") ErrEditConflict = errors.New("edit conflict") )
View Source
var ( ErrDuplicateName = errors.New("duplicate username") ErrDuplicateEmail = errors.New("duplicate email") )
View Source
var AnonymousUser = &User{}
View Source
var ErrInvalidMediaType = errors.New("not a valid MediaType")
Functions ¶
func ValidateEmail ¶
func ValidateFilters ¶
func ValidateTokenPlaintext ¶
func ValidateURL ¶
func ValidateUser ¶
Types ¶
type ArticleModel ¶
func (ArticleModel) Delete ¶
func (a ArticleModel) Delete(itemID int64) error
type Item ¶
type Item struct { ID ItemID `json:"id"` URL string `json:"url"` ItemMetadata CreationTime time.Time `json:"creation_time"` MediaType MediaType `json:"media_type"` Archived bool `json:"archived"` Public bool `json:"public"` Pinned bool `json:"pinned"` ShouldRead bool `json:"should_read"` Read bool `json:"read"` UserID UserID `json:"-"` Version int64 `json:"version"` }
type ItemMetadata ¶
type ItemMetadata struct { Title string `json:"title"` Author null.String `json:"author"` Description null.String `json:"description"` PublicationTime null.Time `json:"publication_time"` ImageURL null.String `json:"image_url"` IconURL null.String `json:"icon_url"` }
type MediaType ¶
type MediaType string
swagger:enum MediaType ENUM(none, article, document, music, video)
const ( // MediaTypeNone is a MediaType of type none. MediaTypeNone MediaType = "none" // MediaTypeArticle is a MediaType of type article. MediaTypeArticle MediaType = "article" // MediaTypeDocument is a MediaType of type document. MediaTypeDocument MediaType = "document" // MediaTypeMusic is a MediaType of type music. MediaTypeMusic MediaType = "music" // MediaTypeVideo is a MediaType of type video. MediaTypeVideo MediaType = "video" )
func ParseMediaType ¶
ParseMediaType attempts to convert a string to a MediaType.
func (MediaType) IsValid ¶
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (MediaType) MarshalText ¶
MarshalText implements the text marshaller method.
func (*MediaType) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type Models ¶
type Models struct { Items ItemModel Articles ArticleModel // Labels LabelModel // LabelCategories LabelCategoryModel Tokens TokenModel Users UserModel }
type TokenModel ¶
func (TokenModel) DeleteAllForUser ¶
func (m TokenModel) DeleteAllForUser(scope string, userID UserID) error
func (TokenModel) Insert ¶
func (m TokenModel) Insert(token *Token) error
type User ¶
type User struct { ID UserID `json:"id"` CreationTime time.Time `json:"creation_time"` Name string `json:"name"` Email string `json:"email"` Password password `json:"-"` Activated bool `json:"activated"` Version int64 `json:"-"` }
func (*User) IsAnonymous ¶
type UserModel ¶
func (UserModel) GetForToken ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.