form

package
v0.0.0-...-5365f31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthForm

type AuthForm struct {
	Username string
	Password string
}

AuthForm represents the authentication form.

func NewAuthForm

func NewAuthForm(r *http.Request) *AuthForm

NewAuthForm returns a new AuthForm.

func (AuthForm) Validate

func (a AuthForm) Validate() error

Validate makes sure the form values are valid.

type CategoryForm

type CategoryForm struct {
	Title string
}

CategoryForm represents a feed form in the UI

func NewCategoryForm

func NewCategoryForm(r *http.Request) *CategoryForm

NewCategoryForm returns a new CategoryForm.

func (CategoryForm) Merge

func (c CategoryForm) Merge(category *model.Category) *model.Category

Merge update the given category fields.

func (CategoryForm) Validate

func (c CategoryForm) Validate() error

Validate makes sure the form values are valid.

type FeedForm

type FeedForm struct {
	FeedURL      string
	SiteURL      string
	Title        string
	ScraperRules string
	RewriteRules string
	Crawler      bool
	CategoryID   int64
	Username     string
	Password     string
}

FeedForm represents a feed form in the UI

func NewFeedForm

func NewFeedForm(r *http.Request) *FeedForm

NewFeedForm parses the HTTP request and returns a FeedForm

func (FeedForm) Merge

func (f FeedForm) Merge(feed *model.Feed) *model.Feed

Merge updates the fields of the given feed.

func (FeedForm) ValidateModification

func (f FeedForm) ValidateModification() error

ValidateModification validates FeedForm fields

type IntegrationForm

type IntegrationForm struct {
	PinboardEnabled      bool
	PinboardToken        string
	PinboardTags         string
	PinboardMarkAsUnread bool
	InstapaperEnabled    bool
	InstapaperUsername   string
	InstapaperPassword   string
	FeverEnabled         bool
	FeverUsername        string
	FeverPassword        string
	WallabagEnabled      bool
	WallabagURL          string
	WallabagClientID     string
	WallabagClientSecret string
	WallabagUsername     string
	WallabagPassword     string
	NunuxKeeperEnabled   bool
	NunuxKeeperURL       string
	NunuxKeeperAPIKey    string
	PocketEnabled        bool
	PocketAccessToken    string
	PocketConsumerKey    string
}

IntegrationForm represents user integration settings form.

func NewIntegrationForm

func NewIntegrationForm(r *http.Request) *IntegrationForm

NewIntegrationForm returns a new AuthForm.

func (IntegrationForm) Merge

func (i IntegrationForm) Merge(integration *model.Integration)

Merge copy form values to the model.

type SettingsForm

type SettingsForm struct {
	Username       string
	Password       string
	Confirmation   string
	Theme          string
	Language       string
	Timezone       string
	EntryDirection string
}

SettingsForm represents the settings form.

func NewSettingsForm

func NewSettingsForm(r *http.Request) *SettingsForm

NewSettingsForm returns a new SettingsForm.

func (*SettingsForm) Merge

func (s *SettingsForm) Merge(user *model.User) *model.User

Merge updates the fields of the given user.

func (*SettingsForm) Validate

func (s *SettingsForm) Validate() error

Validate makes sure the form values are valid.

type SubscriptionForm

type SubscriptionForm struct {
	URL        string
	CategoryID int64
	Crawler    bool
	Username   string
	Password   string
}

SubscriptionForm represents the subscription form.

func NewSubscriptionForm

func NewSubscriptionForm(r *http.Request) *SubscriptionForm

NewSubscriptionForm returns a new SubscriptionForm.

func (*SubscriptionForm) Validate

func (s *SubscriptionForm) Validate() error

Validate makes sure the form values are valid.

type UserForm

type UserForm struct {
	Username     string
	Password     string
	Confirmation string
	IsAdmin      bool
}

UserForm represents the user form.

func NewUserForm

func NewUserForm(r *http.Request) *UserForm

NewUserForm returns a new UserForm.

func (UserForm) Merge

func (u UserForm) Merge(user *model.User) *model.User

Merge updates the fields of the given user.

func (UserForm) ToUser

func (u UserForm) ToUser() *model.User

ToUser returns a User from the form values.

func (UserForm) ValidateCreation

func (u UserForm) ValidateCreation() error

ValidateCreation validates user creation.

func (UserForm) ValidateModification

func (u UserForm) ValidateModification() error

ValidateModification validates user modification.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL