model

package
v0.0.0-...-7d02455 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBookmarkListResponse

func NewBookmarkListResponse(bookmarks []*Bookmark) []render.Renderer

func NewGameListResponse

func NewGameListResponse(games []*Game) []render.Renderer

func NewUserListResponse

func NewUserListResponse(users []*User) []render.Renderer

Types

type Bookmark

type Bookmark struct {
	ID        uuid.UUID    `gorm:"primaryKey" json:"id"`
	Name      string       `json:"name"`
	Type      BookmarkType `json:"type"`
	URL       string       `json:"url,omitempty"`
	Tags      []string     `json:"tags"`
	Children  []*Bookmark  `json:"children,omitempty"`
	CreatedAt time.Time    `json:"created_at"`
	UpdatedAt time.Time    `json:"updated_at"`
}

func (*Bookmark) Bind

func (b *Bookmark) Bind(r *http.Request) error

func (*Bookmark) Render

func (b *Bookmark) Render(_ http.ResponseWriter, _ *http.Request) error

type BookmarkType

type BookmarkType string
const (
	BookmarkTypeFolder   BookmarkType = "folder"
	BookmarkTypeBookmark BookmarkType = "bookmark"
)

type Game

type Game struct {
	ID   uuid.UUID `gorm:"primaryKey" json:"id"`
	Name string    `json:"name"`
}

func (*Game) Bind

func (g *Game) Bind(r *http.Request) error

func (*Game) Render

func (g *Game) Render(_ http.ResponseWriter, _ *http.Request) error

type Secret

type Secret struct {
	ID        string `json:"id"`
	Secret    string `json:"secret"`
	Used      bool   `json:"used"`
	CreatedAt int64  `json:"created_at"`
}

type User

type User struct {
	ID        uuid.UUID `gorm:"primaryKey" json:"id"`
	Login     string    `json:"login"`
	Email     string    `json:"email"`
	Password  string    `json:"-"`
	Name      string    `json:"name"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (*User) Bind

func (u *User) Bind(r *http.Request) error

func (*User) Render

func (u *User) Render(_ http.ResponseWriter, _ *http.Request) error

type Weather

type Weather struct {
	Location    string `json:"location"`
	Temperature string `json:"temperature"`
	Description string `json:"description"`
}

func (*Weather) Render

func (w *Weather) Render(_ http.ResponseWriter, _ *http.Request) error

Jump to

Keyboard shortcuts

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