object

package
v0.0.0-...-e309809 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 12 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 AccountID `json:"-"`

	Username string `json:"username,omitempty"`

	PasswordHash string `json:"-" db:"password_hash"`

	DisplayName *string `json:"display_name,omitempty" db:"display_name"`

	Avatar *string `json:"avatar,omitempty"`

	Header *string `json:"header,omitempty"`

	Note *string `json:"note,omitempty"`

	CreateAt DateTime `json:"create_at,omitempty" db:"create_at"`

	// フォロワーの数
	FollowersCount int64 `json:"followers_count" db:"followers_count"`

	// フォローしているアカウントの数
	FollowingCount int64 `json:"following_count" db:"following_count"`
}

func (*Account) CheckPassword

func (a *Account) CheckPassword(pass string) bool

func (*Account) SetPassword

func (a *Account) SetPassword(pass string) error

type AccountID

type AccountID = int64

type Attachment

type Attachment struct {
	ID          int64  `json:"id"`
	Type        string `json:"type"`
	URL         string `json:"url"`
	Description string `json:"description"`
}

func (*Attachment) CopyFile

func (at *Attachment) CopyFile(file multipart.File, fileName string) error

func (*Attachment) CreateFileName

func (at *Attachment) CreateFileName(h *multipart.FileHeader) string

type DateTime

type DateTime struct{ time.Time }

func (*DateTime) MarshalJSON

func (t *DateTime) MarshalJSON() ([]byte, error)

func (*DateTime) Scan

func (t *DateTime) Scan(value interface{}) error

func (*DateTime) UnMarshalJSON

func (t *DateTime) UnMarshalJSON(b []byte) error

func (*DateTime) Value

func (t *DateTime) Value() (driver.Value, error)

type Favorite

type Favorite struct {
	ID       int      `json:"id"`
	CreateAt DateTime `json:"create_at,omitempty" db:"create_at"`
}

type PasswordHash

type PasswordHash = string

type Relationship

type Relationship struct {
	ID AccountID `json:"id"`

	IsFollowing bool `json:"following"`

	IsFollowedby bool `json:"followed_by"`
}

type Status

type Status struct {
	ID int `json:"id"`

	// AccountID of the status
	AccountID AccountID `json:"-" db:"account_id"`

	Account Account `json:"account"`

	Content string `json:"content"`

	FavoriteCount int64 `json:"favorite_count" db:"favorite_count"`

	CreateAt DateTime `json:"create_at,omitempty" db:"create_at"`
}

Jump to

Keyboard shortcuts

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