model

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 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 Album

type Album struct {
	Uuid string `json:"uuid"`

	CreatedAt time.Time `json:"created_at"`

	UpdatedAt time.Time `json:"updated_at,omitempty"`

	Link string `json:"link"`

	AlbumType AlbumType `json:"album_type"`

	Visibility Visibility `json:"visibility"`

	Name string `json:"name"`

	Description string `json:"description,omitempty"`

	User User `json:"user"`

	Images []Image `json:"images,omitempty"`
}

type AlbumType

type AlbumType string
const (
	ProfilePics AlbumType = "profile_pics"
	UserCreated AlbumType = "user_created"
	Livestream  AlbumType = "livestream"
)

List of AlbumType

type Claims added in v0.1.4

type Claims struct {
	UserUuid string `json:"userUuid"`
	jwt.RegisteredClaims
}

type Image

type Image struct {
	Uuid string `json:"uuid"`

	Filename string `json:"filename"`

	S3Key string `json:"s3_key"`

	CreatedAt time.Time `json:"created_at"`

	Link string `json:"link"`

	Album Album `json:"album"`

	User User `json:"user"`
}

type NewAlbum

type NewAlbum struct {
	Visibility Visibility `json:"visibility"`

	Name string `json:"name"`

	Description string `json:"description,omitempty"`

	Link string `json:"link,omitempty"`

	User User `json:"user,omitempty"`
}

func DecodeRequestToNewAlbum

func DecodeRequestToNewAlbum(r *http.Request) *NewAlbum

type NewImage

type NewImage struct {
	Filename string `json:"filename"`

	Link string `json:"link,omitempty"`

	Image string `json:"image,omitempty"`
}

func DecodeRequestToNewImage

func DecodeRequestToNewImage(r *http.Request) *NewImage

type Session added in v0.1.4

type Session struct {
	User  User   `json:"user"`
	Token string `json:"token,omitempty"`
}

Session struct for Session

type User

type User struct {
	Uuid string `json:"uuid"`

	Username string `json:"username"`

	Albums []Album `json:"albums,omitempty"`
}

User struct for User

func DecodeMessageToUser

func DecodeMessageToUser(message []byte) (*User, error)

type Visibility

type Visibility string

Visibility the model 'Visibility'

const (
	PUBLIC  Visibility = "public"
	PRIVATE Visibility = "private"
)

List of Visibility

Jump to

Keyboard shortcuts

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