dto

package
v0.0.0-...-f348597 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BanOpts

type BanOpts struct {
	Token         string
	UIDorUsername string
}

Used to unban user as well

func (*BanOpts) Validate

func (opts *BanOpts) Validate() error

type ChangeLoginOpts

type ChangeLoginOpts struct {
	Token    string
	Password string
	NewLogin string
}

func (*ChangeLoginOpts) Validate

func (opts *ChangeLoginOpts) Validate() error

type ChangeNameOpts

type ChangeNameOpts struct {
	Token   string
	NewName string
}

TODO

func (*ChangeNameOpts) Validate

func (opts *ChangeNameOpts) Validate() error

type ChangePasswordOpts

type ChangePasswordOpts struct {
	Token       string
	OldPassord  string
	NewPassword string
}

func (*ChangePasswordOpts) Validate

func (opts *ChangePasswordOpts) Validate() error

type CreateUserOpts

type CreateUserOpts struct {
	// User info
	Name     string
	Login    string
	Password string
	// Session info
	DeviceInfo string
	IpAddr     string
}

Options

func (*CreateUserOpts) Validate

func (opts *CreateUserOpts) Validate() error

type CreateUserResp

type CreateUserResp struct {
	Token string
}

type GetAllMySessionsResp

type GetAllMySessionsResp struct {
	Sessions        []entities.Session
	CountOfSessions int
}

type GetAllSessionsOpts

type GetAllSessionsOpts struct {
	Token string
	UID   uuid.UUID
}

type GetAllSessionsResp

type GetAllSessionsResp struct {
	Sessions        []entities.Session
	CountOfSessions int
}

type GetMeResp

type GetMeResp struct {
	ID        uuid.UUID
	Username  string
	Login     string
	Name      string
	CreatedAt time.Time
}

type GetSessionOpts

type GetSessionOpts struct {
	Token    string
	SidOrTkn string
}

type GetSessionResp

type GetSessionResp struct {
	SID       uuid.UUID `json:"sessionID"`
	UID       uuid.UUID `json:"usrID"`
	CreatedAt int64     `json:"createdAt"`
	DeviceInf string    `json:"deviceInf"`
	CreatorIP string    `json:"creatorIP"`
	Current   bool      `json:"current"`
}

type GetUIdByUsernameOpts

type GetUIdByUsernameOpts struct {
	Username username.Username
}

type GetUserOpts

type GetUserOpts struct {
	UIDorUsername string
	Token         string `validate:"len=64"`
}

func (*GetUserOpts) Validate

func (opts *GetUserOpts) Validate() error

type GetUserResp

type GetUserResp struct {
	ID        uuid.UUID
	Name      string
	Username  username.Username
	Banned    bool
	CreatedAt time.Time
}

Some fields may be nil or an empty string

type KillSessionOpts

type KillSessionOpts struct {
	Token string
	SID   uuid.UUID
}

type LoginOpts

type LoginOpts struct {
	Password   string
	Login      string
	DeviceInfo string
	IpAddr     string
}

type LoginResponse

type LoginResponse struct {
	Token string
}

type RemoveUserOpts

type RemoveUserOpts struct {
	UIDorUsername string
	Token         string `validate:"len=64"`
}

func (*RemoveUserOpts) Validate

func (opts *RemoveUserOpts) Validate() error

type Session

type Session struct {
	SID       uuid.UUID `json:"sessionID"`
	UID       uuid.UUID `json:"usrID"`
	CreatedAt int64     `json:"createdAt"`
	DeviceInf string    `json:"deviceInf"`
	CreatorIP string    `json:"creatorIP"`
}

type SetUsernameOpts

type SetUsernameOpts struct {
	Token        string
	UsernameBase string
}

func (*SetUsernameOpts) Validate

func (opts *SetUsernameOpts) Validate() error

type TestUsernameOpts

type TestUsernameOpts struct {
	UsernameBase string
}

func (*TestUsernameOpts) Validate

func (opts *TestUsernameOpts) Validate() error

Jump to

Keyboard shortcuts

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