models

package
v0.0.0-...-492be6d Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gender

type Gender string
const (
	Male   Gender = "male"
	Female Gender = "female"
)

func (*Gender) UnmarshalJSON

func (g *Gender) UnmarshalJSON(data []byte) error

func (Gender) Value

func (g Gender) Value() (driver.Value, error)

type Message

type Message struct {
	From int64  `josn:"from"`
	To   int64  `json:"to"`
	Text string `json:"text"`
}

type Post

type Post struct {
	ID        int64     `json:"id"`
	UserID    int64     `json:"userId"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"createdAt,omitempty"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type ServerResponse

type ServerResponse struct {
	Ok      bool        `json:"ok"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

type User

type User struct {
	UserName  string    `json:"username"`
	FirstName *string   `json:"firstName,omitempty"`
	LastName  *string   `json:"lastName,omitempty"`
	Birthday  *UserDate `json:"birthday,omitempty"`
	Gender    *Gender   `json:"gender,omitempty"`
	Interests []string  `json:"interests,omitempty"`
	City      *string   `json:"city,omitempty"`
}

type UserDate

type UserDate time.Time

func (*UserDate) MarshalJSON

func (d *UserDate) MarshalJSON() ([]byte, error)

func (*UserDate) Scan

func (d *UserDate) Scan(value interface{}) error

func (*UserDate) UnmarshalJSON

func (d *UserDate) UnmarshalJSON(data []byte) error

func (UserDate) Value

func (d UserDate) Value() (driver.Value, error)

type UserWithPassword

type UserWithPassword struct {
	User
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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