model

package
v0.0.0-...-5b8dc76 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	BlockerID string `json:"blocker_id"`
	BlockedID string `json:"blocked_id"`
}

type Favorite

type Favorite struct {
	UserID    string    `json:"user_id"`
	PostID    string    `json:"post_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type Image

type Image struct {
	Blob  []byte
	CRC32 uint32
}

func NewImage

func NewImage(r io.Reader) (*Image, error)

func (*Image) Reader

func (i *Image) Reader() io.Reader

type Post

type Post struct {
	ID        string    `json:"id"`
	UserID    string    `json:"user_id"`
	Body      string    `json:"body"`
	Photo     *Image    `json:"photo"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*Post) CreateRequestBody

func (p *Post) CreateRequestBody() (string, io.Reader, error)

type User

type User struct {
	ID          string    `json:"id"`
	Login       string    `json:"login"`
	DisplayName string    `json:"display_name"`
	Icon        *Image    `json:"icon"`
	Cover       *Image    `json:"cover"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

func (*User) LoginRequestBody

func (u *User) LoginRequestBody() (string, io.Reader, error)

func (*User) SignupRequestBody

func (u *User) SignupRequestBody() (string, io.Reader, error)

Jump to

Keyboard shortcuts

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