models

package
v0.0.0-...-c901fe9 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                    int64     `json:"id" db:"id"`
	UUID                  uuid.UUID `json:"uuid" db:"uuid"`
	CreatedAt             time.Time `json:"created_at" db:"created_at"`
	UpdatedAt             time.Time `json:"updated_at" db:"updated_at"`
	Username              string    `json:"username" db:"username"`
	Domain                string    `json:"domain" db:"domain"`
	Secret                string    `json:"secret" db:"secret"`
	PrivateKey            string    `json:"private_key" db:"private_key"`
	PublicKey             string    `json:"public_key" db:"public_key"`
	RemoteURL             string    `json:"remote_url" db:"remote_url"`
	SalmonURL             string    `json:"salmon_url" db:"salmon_url"`
	HubURL                string    `json:"hub_url" db:"hub_url"`
	Note                  string    `json:"note" db:"note"`
	DisplayName           string    `json:"display_name" db:"display_name"`
	URI                   string    `json:"uri" db:"uri"`
	URL                   string    `json:"url" db:"url"`
	AvatarFileName        string    `json:"avatar_file_name" db:"avatar_file_name"`
	AvatarContentType     string    `json:"avatar_content_type" db:"avatar_content_type"`
	AvatarFileSize        int       `json:"avatar_file_size" db:"avatar_file_size"`
	AvatarUpdatedAt       time.Time `json:"avatar_updated_at" db:"avatar_updated_at"`
	HeaderFileName        string    `json:"header_file_name" db:"header_file_name"`
	HeaderContentType     string    `json:"header_content_type" db:"header_content_type"`
	HeaderFileSize        int       `json:"header_file_size" db:"header_file_size"`
	HeaderUpdatedAt       time.Time `json:"header_updated_at" db:"header_updated_at"`
	AvatarRemoteURL       string    `json:"avatar_remote_url" db:"avatar_remote_url"`
	SubscriptionExpiresAt time.Time `json:"subscription_expires_at" db:"subscription_expires_at"`
	Silenced              bool      `json:"silenced" db:"silenced"`
	Suspended             bool      `json:"suspended" db:"suspended"`
	Locked                bool      `json:"locked" db:"locked"`
	HeaderRemoteURL       string    `json:"header_remote_url" db:"header_remote_url"`
	StatusesCount         int       `json:"statuses_count" db:"statuses_count"`
	FollowersCount        int       `json:"followers_count" db:"followers_count"`
	FollowingCount        int       `json:"following_count" db:"following_count"`
	LastWebfingeredAt     time.Time `json:"last_webfingered_at" db:"last_webfingered_at"`
	InboxURL              string    `json:"inbox_url" db:"inbox_url"`
	OutboxURL             string    `json:"outbox_url" db:"outbox_url"`
	SharedInboxURL        string    `json:"shared_inbox_url" db:"shared_inbox_url"`
	FollowersURL          string    `json:"followers_url" db:"followers_url"`
	Protocol              int       `json:"protocol" db:"protocol"`
	Memorial              bool      `json:"memorial" db:"memorial"`
	MovedToAccountID      AccountId `json:"moved_to_account_id" db:"moved_to_account_id"`
	FeaturedCollectionURL string    `json:"featured_collection_url" db:"featured_collection_url"`
}

func (Account) Acct

func (a Account) Acct() string

func (Account) Avatar

func (a Account) Avatar() string

func (Account) AvatarStatic

func (a Account) AvatarStatic() string

func (Account) FullyQualifiedAcct

func (a Account) FullyQualifiedAcct() string

func (*Account) GenerateCryptoKeys

func (a *Account) GenerateCryptoKeys()

func (Account) Header

func (a Account) Header() string

func (Account) HeaderStatic

func (a Account) HeaderStatic() string

func (Account) Local

func (a Account) Local() bool

func (Account) String

func (a Account) String() string

String is not required by pop and may be deleted

func (*Account) Validate

func (a *Account) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Account) ValidateCreate

func (a *Account) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Account) ValidateUpdate

func (a *Account) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type AccountId

type AccountId struct {
	// contains filtered or unexported fields
}

func (AccountId) Scan

func (id AccountId) Scan(src interface{}) error

func (AccountId) Value

func (id AccountId) Value() (driver.Value, error)

type Accounts

type Accounts []Account

Accounts is not required by pop and may be deleted

func (Accounts) String

func (a Accounts) String() string

String is not required by pop and may be deleted

type Status

type Status struct {
	ID                 int64     `json:"id" db:"id"`
	URI                string    `json:"uri" db:"uri"`
	Text               string    `json:"text" db:"text"`
	CreatedAt          time.Time `json:"created_at" db:"created_at"`
	UpdatedAt          time.Time `json:"updated_at" db:"updated_at"`
	InReplyToID        int       `json:"in_reply_to_id" db:"in_reply_to_id"`
	ReblogOfID         int       `json:"reblog_of_id" db:"reblog_of_id"`
	URL                string    `json:"url" db:"url"`
	Sensitive          bool      `json:"sensitive" db:"sensitive"`
	Visibility         int       `json:"visibility" db:"visibility"`
	SpoilerText        string    `json:"spoiler_text" db:"spoiler_text"`
	Reply              bool      `json:"reply" db:"reply"`
	FavouritesCount    int       `json:"favourites_count" db:"favourites_count"`
	ReblogsCount       int       `json:"reblogs_count" db:"reblogs_count"`
	Language           string    `json:"language" db:"language"`
	ConversationID     int       `json:"conversation_id" db:"conversation_id"`
	Local              bool      `json:"local" db:"local"`
	AccountID          int       `json:"account_id" db:"account_id"`
	ApplicationID      int       `json:"application_id" db:"application_id"`
	InReplyToAccountID int       `json:"in_reply_to_account_id" db:"in_reply_to_account_id"`
	StatusAccount      Account   `db:"-"`
}

func (*Status) Avatar

func (s *Status) Avatar() template.HTML

func (Status) String

func (s Status) String() string

String is not required by pop and may be deleted

func (*Status) TimeAgo

func (s *Status) TimeAgo() string

func (*Status) Validate

func (s *Status) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*Status) ValidateCreate

func (s *Status) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*Status) ValidateUpdate

func (s *Status) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type Statuses

type Statuses []Status

Statuses is not required by pop and may be deleted

func (Statuses) String

func (s Statuses) String() string

String is not required by pop and may be deleted

type User

type User struct {
	ID                     int64     `json:"id" db:"id"`
	Email                  string    `json:"email" db:"email"`
	CreatedAt              time.Time `json:"created_at" db:"created_at"`
	UpdatedAt              time.Time `json:"updated_at" db:"updated_at"`
	EncryptedPassword      string    `json:"encrypted_password" db:"encrypted_password"`
	ResetPasswordToken     string    `json:"reset_password_token" db:"reset_password_token"`
	ResetPasswordSentAt    time.Time `json:"reset_password_sent_at" db:"reset_password_sent_at"`
	RememberCreatedAt      time.Time `json:"remember_created_at" db:"remember_created_at"`
	SignInCount            int       `json:"sign_in_count" db:"sign_in_count"`
	CurrentSignInAt        time.Time `json:"current_sign_in_at" db:"current_sign_in_at"`
	LastSignInAt           time.Time `json:"last_sign_in_at" db:"last_sign_in_at"`
	CurrentSignInIp        UserIP    `json:"current_sign_in_ip" db:"current_sign_in_ip"`
	LastSignInIp           UserIP    `json:"last_sign_in_ip" db:"last_sign_in_ip"`
	Admin                  bool      `json:"admin" db:"admin"`
	ConfirmationToken      string    `json:"confirmation_token" db:"confirmation_token"`
	ConfirmedAt            time.Time `json:"confirmed_at" db:"confirmed_at"`
	ConfirmationSentAt     time.Time `json:"confirmation_sent_at" db:"confirmation_sent_at"`
	UnconfirmedEmail       string    `json:"unconfirmed_email" db:"unconfirmed_email"`
	Locale                 string    `json:"locale" db:"locale"`
	EncryptedOtpSecret     string    `json:"encrypted_otp_secret" db:"encrypted_otp_secret"`
	EncryptedOtpSecretIv   string    `json:"encrypted_otp_secret_iv" db:"encrypted_otp_secret_iv"`
	EncryptedOtpSecretSalt string    `json:"encrypted_otp_secret_salt" db:"encrypted_otp_secret_salt"`
	ConsumedTimestep       int       `json:"consumed_timestep" db:"consumed_timestep"`
	OtpRequiredForLogin    bool      `json:"otp_required_for_login" db:"otp_required_for_login"`
	LastEmailedAt          time.Time `json:"last_emailed_at" db:"last_emailed_at"`
	OtpBackupCodes         string    `json:"otp_backup_codes" db:"otp_backup_codes"`
	FilteredLanguages      string    `json:"filtered_languages" db:"filtered_languages"`
	AccountID              int64     `json:"account_id" db:"account_id" belongs_to:"account"`
	Disabled               bool      `json:"disabled" db:"disabled"`
	Moderator              bool      `json:"moderator" db:"moderator"`
	InviteID               int       `json:"invite_id" db:"invite_id"`
	RememberToken          string    `json:"remember_token" db:"remember_token"`
}

func NewUser

func NewUser() User

func (*User) CreateAccount

func (u *User) CreateAccount(tx *pop.Connection, username string) (*Account, error)

func (User) String

func (u User) String() string

String is not required by pop and may be deleted

func (*User) Validate

func (u *User) Validate(tx *pop.Connection) (*validate.Errors, error)

Validate gets run every time you call a "pop.Validate*" (pop.ValidateAndSave, pop.ValidateAndCreate, pop.ValidateAndUpdate) method. This method is not required and may be deleted.

func (*User) ValidateCreate

func (u *User) ValidateCreate(tx *pop.Connection) (*validate.Errors, error)

ValidateCreate gets run every time you call "pop.ValidateAndCreate" method. This method is not required and may be deleted.

func (*User) ValidateUpdate

func (u *User) ValidateUpdate(tx *pop.Connection) (*validate.Errors, error)

ValidateUpdate gets run every time you call "pop.ValidateAndUpdate" method. This method is not required and may be deleted.

type UserIP

type UserIP net.IPAddr

func (UserIP) Scan

func (ip UserIP) Scan(src interface{}) error

func (UserIP) Value

func (ip UserIP) Value() (driver.Value, error)

type Users

type Users []User

Users is not required by pop and may be deleted

func (Users) String

func (u Users) String() string

String is not required by pop and may be deleted

Jump to

Keyboard shortcuts

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