model

package
v0.0.0-...-52cd6b4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	CreateAction Action = "CREATE"
	DeleteAction Action = "DELETE"
)

func (Action) String

func (id Action) String() string

type AddFriendParams

type AddFriendParams struct {
	FID        FriendID `validator:"nonzero"`
	SID        FriendID `validator:"nonzero"`
	AuthorID   UserID   `validator:"nonzero"`
	FollowerID UserID   `validator:"nonzero"`
}

func (*AddFriendParams) Validate

func (t *AddFriendParams) Validate() error

type CreatePostParams

type CreatePostParams struct {
	ID       PostID `validator:"nonzero"`
	Text     string `validator:"nonzero"`
	AuthorID UserID `validator:"nonzero"`
}

func (*CreatePostParams) Validate

func (p *CreatePostParams) Validate() error

type Dialog

type Dialog struct {
	ID              DialogID `validator:"nonzero"`
	ParticipantsIDs []UserID `validator:"nonzero"`
}

func (*Dialog) Validate

func (d *Dialog) Validate() error

type DialogID

type DialogID string

func (DialogID) String

func (d DialogID) String() string

type Friend

type Friend struct {
	UserID     UserID
	Username   string
	FirstName  string
	SecondName string
}

type FriendID

type FriendID string

func (FriendID) String

func (id FriendID) String() string

type Message

type Message struct {
	ID       MessageID `validator:"nonzero"`
	DialogID DialogID  `validator:"nonzero"`
	SenderID UserID    `validator:"nonzero"`
	Text     string    `validator:"nonzero"`
}

func (*Message) Validate

func (m *Message) Validate() error

type MessageID

type MessageID string

func (MessageID) String

func (m MessageID) String() string

type Post

type Post struct {
	ID       PostID `validator:"nonzero"`
	Text     string `validator:"nonzero"`
	AuthorID UserID `validator:"nonzero"`
}

func (*Post) MarshalBinary

func (p *Post) MarshalBinary() ([]byte, error)

func (*Post) UnmarshalBinary

func (p *Post) UnmarshalBinary(data []byte) error

func (*Post) Validate

func (p *Post) Validate() error

type PostAction

type PostAction struct {
	Action Action
	Post   *Post
}

func (*PostAction) MarshalBinary

func (p *PostAction) MarshalBinary() ([]byte, error)

func (*PostAction) UnmarshalBinary

func (p *PostAction) UnmarshalBinary(data []byte) error

type PostID

type PostID string

func (PostID) String

func (id PostID) String() string

type TarantoolUser

type TarantoolUser struct {
	UserID         string `json:"id"`
	FirstName      string `json:"first_name"`
	SecondName     string `json:"second_name"`
	Username       string `json:"username"`
	HashedPassword string `json:"hashed_password"`
	Sex            string `json:"sex"`
	Biography      string `json:"biography"`
	City           string `json:"city"`
}

func (*TarantoolUser) DecodeMsgpack

func (t *TarantoolUser) DecodeMsgpack(d *msgpack.Decoder) error

type Token

type Token struct {
	TokenID        TokenID   `validator:"nonzero"`
	UserID         UserID    `validator:"nonzero"`
	Token          string    `validator:"nonzero"`
	ExpirationDate time.Time `validator:"nonzero"`
}

func (*Token) Validate

func (t *Token) Validate() error

type TokenID

type TokenID string

func (TokenID) String

func (id TokenID) String() string

type User

type User struct {
	UserID         UserID `json:"id"`
	Username       string `json:"username"`
	HashedPassword string `json:"hashed_password"`
	FirstName      string `json:"first_name"`
	SecondName     string `json:"second_name"`
	Sex            string `json:"sex"`
	Birthdate      time.Time
	Biography      string `json:"biography"`
	City           string `json:"city"`
}

type UserID

type UserID string

func (UserID) String

func (id UserID) String() string

type UserLogin

type UserLogin struct {
	Username string
}

type UserRegister

type UserRegister struct {
	ID             string    `validator:"nonzero"`
	Username       string    `validator:"nonzero"`
	HashedPassword string    `validator:"nonzero"`
	FirstName      string    `validator:"nonzero"`
	SecondName     string    `validator:"nonzero"`
	Sex            string    `validator:"nonzero"`
	Birthdate      time.Time `validator:"nonzero"`
	Biography      string    `validator:"nonzero"`
	City           string    `validator:"nonzero"`
}

func (*UserRegister) Validate

func (u *UserRegister) Validate() error

Jump to

Keyboard shortcuts

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