Documentation ¶
Index ¶
- Variables
- type Article
- type ArticleCreateForm
- type ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Build() *ArticleCreateForm
- func (b *ArticleCreateFormBuilder) CategoryID(categoryID uint) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) FromArticle(article Article) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) HTML(_html string) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Origin(origin string) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Random() *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Tags(tags string) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Text(text string) *ArticleCreateFormBuilder
- func (b *ArticleCreateFormBuilder) Title(title string) *ArticleCreateFormBuilder
- type ArticleUpdateForm
- type ArticlesPageRequest
- type ArticlesPageResponse
- type Category
- type CategoryCreateForm
- type CategoryCreateFormBuilder
- type CategoryUpdateForm
- type CreatedArticlesResponse
- type Device
- type DeviceBuilder
- type DeviceNotification
- type IncomingWebhook
- type IncomingWebhookCreateForm
- type IncomingWebhookCreateFormBuilder
- type IncomingWebhookUpdateForm
- type OutgoingWebhook
- type OutgoingWebhookCreateForm
- type OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) Alias(alias string) *OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) Build() *OutgoingWebhookCreateForm
- func (ab *OutgoingWebhookCreateFormBuilder) Config(config string) *OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) Dummy() *OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) IsDefault(isDefault bool) *OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) Provider(provider string) *OutgoingWebhookCreateFormBuilder
- func (ab *OutgoingWebhookCreateFormBuilder) Secrets(secrets secret.Secrets) *OutgoingWebhookCreateFormBuilder
- type OutgoingWebhookUpdateForm
- type Properties
- type User
- type UserForm
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyExists = errors.New("already exists")
ErrAlreadyExists if an object already exists
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID uint `json:"id,omitempty"` UserID uint `json:"user_id,omitempty"` CategoryID *uint `json:"category_id,omitempty"` Title string `json:"title,omitempty"` Text *string `json:"text,omitempty"` HTML *string `json:"html,omitempty"` URL *string `json:"url,omitempty"` Image *string `json:"image,omitempty"` Hash string `json:"hash,omitempty"` Status string `json:"status,omitempty"` Stars uint `json:"stars,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Article structure definition
type ArticleCreateForm ¶
type ArticleCreateForm struct { Title string `json:"title,omitempty"` Text *string `json:"text,omitempty"` HTML *string `json:"html,omitempty"` URL *string `json:"url,omitempty"` Image *string `json:"image,omitempty"` PublishedAt *time.Time `json:"published_at,omitempty"` CategoryID *uint `json:"category,omitempty"` Origin *string `json:"origin,omitempty"` Tags *string `json:"tags,omitempty"` }
ArticleCreateForm structure definition
func (ArticleCreateForm) IsComplete ¶
func (form ArticleCreateForm) IsComplete() bool
IsComplete test if the form is complete
func (ArticleCreateForm) Payload ¶
func (form ArticleCreateForm) Payload() string
Payload return form payload (content without HTML tags)
func (ArticleCreateForm) TruncatedTitle ¶
func (form ArticleCreateForm) TruncatedTitle() string
TruncatedTitle return truncated title
type ArticleCreateFormBuilder ¶
type ArticleCreateFormBuilder struct {
// contains filtered or unexported fields
}
ArticleCreateFormBuilder is a builder to create an Article create form
func NewArticleCreateFormBuilder ¶
func NewArticleCreateFormBuilder() ArticleCreateFormBuilder
NewArticleCreateFormBuilder creates new Article create form builder instance
func (*ArticleCreateFormBuilder) Build ¶
func (b *ArticleCreateFormBuilder) Build() *ArticleCreateForm
Build creates the article create form
func (*ArticleCreateFormBuilder) CategoryID ¶
func (b *ArticleCreateFormBuilder) CategoryID(categoryID uint) *ArticleCreateFormBuilder
CategoryID set article category ID
func (*ArticleCreateFormBuilder) FromArticle ¶
func (b *ArticleCreateFormBuilder) FromArticle(article Article) *ArticleCreateFormBuilder
FromArticle fill article create form internal article
func (*ArticleCreateFormBuilder) HTML ¶
func (b *ArticleCreateFormBuilder) HTML(_html string) *ArticleCreateFormBuilder
HTML set article HTML
func (*ArticleCreateFormBuilder) Origin ¶
func (b *ArticleCreateFormBuilder) Origin(origin string) *ArticleCreateFormBuilder
Origin set article origin
func (*ArticleCreateFormBuilder) Random ¶
func (b *ArticleCreateFormBuilder) Random() *ArticleCreateFormBuilder
Random fill article create form with random data
func (*ArticleCreateFormBuilder) Tags ¶
func (b *ArticleCreateFormBuilder) Tags(tags string) *ArticleCreateFormBuilder
Tags set article tags
func (*ArticleCreateFormBuilder) Text ¶
func (b *ArticleCreateFormBuilder) Text(text string) *ArticleCreateFormBuilder
Text set article text
func (*ArticleCreateFormBuilder) Title ¶
func (b *ArticleCreateFormBuilder) Title(title string) *ArticleCreateFormBuilder
Title set article title
type ArticleUpdateForm ¶
type ArticleUpdateForm struct { ID uint Title *string Text *string CategoryID *uint Status *string Stars *int }
ArticleUpdateForm structure definition
type ArticlesPageRequest ¶
type ArticlesPageRequest struct { Status *string Starred *bool Category *uint Query *string AfterCursor *uint SortOrder *string SortBy *string Limit *int }
ArticlesPageRequest request structure for a paginated list of articles
type ArticlesPageResponse ¶
ArticlesPageResponse response structure for a paginated list of articles
type Category ¶
type Category struct { ID *uint `json:"id,omitempty"` UserID *uint `json:"user_id,omitempty"` Title string `json:"title,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
Category structure definition
type CategoryCreateForm ¶
type CategoryCreateForm struct {
Title string
}
CategoryCreateForm structure definition
type CategoryCreateFormBuilder ¶
type CategoryCreateFormBuilder struct {
// contains filtered or unexported fields
}
CategoryCreateFormBuilder is a builder to create an CategoryCreateForm
func NewCategoryCreateFormBuilder ¶
func NewCategoryCreateFormBuilder() CategoryCreateFormBuilder
NewCategoryCreateFormBuilder creates new Category create form builder instance
func (*CategoryCreateFormBuilder) Build ¶
func (cb *CategoryCreateFormBuilder) Build() *CategoryCreateForm
Build creates the category create form
func (*CategoryCreateFormBuilder) Random ¶
func (cb *CategoryCreateFormBuilder) Random() *CategoryCreateFormBuilder
Random fill category with random data
type CategoryUpdateForm ¶
CategoryUpdateForm structure definition
type CreatedArticlesResponse ¶
CreatedArticlesResponse structure definition
type Device ¶
type Device struct { ID *uint `json:"id,omitempty"` UserID *uint `json:"user_id,omitempty"` Key string `json:"key,omitempty"` Subscription *webpush.Subscription `json:"_"` LastSeenAt *time.Time `json:"last_seen_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` }
Device structure definition Device key is a hash of the subscription payload and is used to prevent subscription duplication
func (*Device) GetSubscription ¶
GetSubscription get JSON string of the subscription
func (*Device) SetSubscription ¶
SetSubscription set subscription from JSON string
type DeviceBuilder ¶
type DeviceBuilder struct {
// contains filtered or unexported fields
}
DeviceBuilder is a builder to create an Device
func NewDeviceBuilder ¶
func NewDeviceBuilder() DeviceBuilder
NewDeviceBuilder creates new Device builder instance
func (*DeviceBuilder) Subscription ¶
func (ab *DeviceBuilder) Subscription(sub string) *DeviceBuilder
Subscription set device subscription
func (*DeviceBuilder) UserID ¶
func (ab *DeviceBuilder) UserID(userID uint) *DeviceBuilder
UserID set device user ID
type DeviceNotification ¶
type DeviceNotification struct { Title string `json:"title,omitempty"` Body string `json:"body,omitempty"` Href string `json:"href,omitempty"` }
DeviceNotification structure definition
type IncomingWebhook ¶
type IncomingWebhook struct { ID *uint `json:"id,omitempty"` UserID uint `json:"user_id,omitempty"` Alias string `json:"alias,omitempty"` Token string `json:"token,omitempty"` Script string `json:"script,omitempty"` LastUsageAt *time.Time `json:"last_usage_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
IncomingWebhook structure definition
type IncomingWebhookCreateForm ¶
IncomingWebhookCreateForm structure definition
type IncomingWebhookCreateFormBuilder ¶
type IncomingWebhookCreateFormBuilder struct {
// contains filtered or unexported fields
}
IncomingWebhookCreateFormBuilder is a builder to create an incoming webhook create form
func NewIncomingWebhookCreateFormBuilder ¶
func NewIncomingWebhookCreateFormBuilder() IncomingWebhookCreateFormBuilder
NewIncomingWebhookCreateFormBuilder creates new incoming webhook builder instance
func (*IncomingWebhookCreateFormBuilder) Alias ¶
func (ab *IncomingWebhookCreateFormBuilder) Alias(alias string) *IncomingWebhookCreateFormBuilder
Alias set incoming webhook alias
func (*IncomingWebhookCreateFormBuilder) Build ¶
func (ab *IncomingWebhookCreateFormBuilder) Build() *IncomingWebhookCreateForm
Build creates the incoming webhook
func (*IncomingWebhookCreateFormBuilder) Script ¶
func (ab *IncomingWebhookCreateFormBuilder) Script(script string) *IncomingWebhookCreateFormBuilder
Script set incoming webhook script
type IncomingWebhookUpdateForm ¶
IncomingWebhookUpdateForm structure definition
type OutgoingWebhook ¶
type OutgoingWebhook struct { ID *uint `json:"id,omitempty"` UserID *uint `json:"user_id,omitempty"` Alias string `json:"alias,omitempty"` IsDefault bool `json:"is_default,omitempty"` Provider string `json:"provider,omitempty"` Config string `json:"config,omitempty"` Secrets secret.Secrets `json:"-"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
OutgoingWebhook structure definition
type OutgoingWebhookCreateForm ¶
type OutgoingWebhookCreateForm struct { Alias string IsDefault bool Provider string Config string Secrets secret.Secrets }
OutgoingWebhookCreateForm structure definition
type OutgoingWebhookCreateFormBuilder ¶
type OutgoingWebhookCreateFormBuilder struct {
// contains filtered or unexported fields
}
OutgoingWebhookCreateFormBuilder is a builder to create an outgoing webhook create form
func NewOutgoingWebhookCreateFormBuilder ¶
func NewOutgoingWebhookCreateFormBuilder() OutgoingWebhookCreateFormBuilder
NewOutgoingWebhookCreateFormBuilder creates new outgoing webhook builder instance
func (*OutgoingWebhookCreateFormBuilder) Alias ¶
func (ab *OutgoingWebhookCreateFormBuilder) Alias(alias string) *OutgoingWebhookCreateFormBuilder
Alias set alias
func (*OutgoingWebhookCreateFormBuilder) Build ¶
func (ab *OutgoingWebhookCreateFormBuilder) Build() *OutgoingWebhookCreateForm
Build creates the outgoing webhook create form
func (*OutgoingWebhookCreateFormBuilder) Config ¶
func (ab *OutgoingWebhookCreateFormBuilder) Config(config string) *OutgoingWebhookCreateFormBuilder
Config set config
func (*OutgoingWebhookCreateFormBuilder) Dummy ¶
func (ab *OutgoingWebhookCreateFormBuilder) Dummy() *OutgoingWebhookCreateFormBuilder
Dummy fill outgoing webhook with test data
func (*OutgoingWebhookCreateFormBuilder) IsDefault ¶
func (ab *OutgoingWebhookCreateFormBuilder) IsDefault(isDefault bool) *OutgoingWebhookCreateFormBuilder
IsDefault set is default
func (*OutgoingWebhookCreateFormBuilder) Provider ¶
func (ab *OutgoingWebhookCreateFormBuilder) Provider(provider string) *OutgoingWebhookCreateFormBuilder
Provider set provider
func (*OutgoingWebhookCreateFormBuilder) Secrets ¶
func (ab *OutgoingWebhookCreateFormBuilder) Secrets(secrets secret.Secrets) *OutgoingWebhookCreateFormBuilder
Secrets set secrets
type OutgoingWebhookUpdateForm ¶
type OutgoingWebhookUpdateForm struct { ID uint Alias *string IsDefault *bool Provider *string Config *string Secrets *secret.Secrets }
OutgoingWebhookUpdateForm structure definition
type Properties ¶
type Properties struct { Rev *uint VAPIDPublicKey string VAPIDPrivateKey string CreatedAt *time.Time }
Properties structure definition
type User ¶
type User struct { ID *uint `json:"id,omitempty"` Username string `json:"username,omitempty"` Enabled bool `json:"enabled,omitempty"` Plan string `json:"plan,omitempty"` CustomerID string `json:"customer_id,omitempty"` LastLoginAt *time.Time `json:"last_login_at,omitempty"` CreatedAt *time.Time `json:"created_at,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
User structure definition