model

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 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 Claims added in v0.1.10

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

type Follow

type Follow struct {
	Uuid      string    `json:"uuid"`
	User      User      `json:"user"`
	Following User      `json:"following"`
	DeletedAt time.Time `json:"deleted_at,omitempty"`
}

func DecodeMessageToFollow

func DecodeMessageToFollow(message []byte) (*Follow, error)

type Notification

type Notification struct {
	Uuid             string           `json:"uuid"`
	CreatedAt        time.Time        `json:"created_at,omitempty"`
	User             User             `json:"user"`
	Seen             bool             `json:"seen"`
	Link             string           `json:"link"`
	NotificationType NotificationType `json:"notificationType,omitempty"`
	TriggeredByUser  User             `json:"triggered_by_user,omitempty"`
}

type NotificationAcknowledgement

type NotificationAcknowledgement struct {
	DatetimeStarted time.Time `json:"datetime_started"`
	DatetimeEnded   time.Time `json:"datetime_ended"`
}

func DecodeRequestToNotificationAcknowledgement

func DecodeRequestToNotificationAcknowledgement(r *http.Request) (*NotificationAcknowledgement, error)

type NotificationType

type NotificationType string
const (
	POST_LIKED NotificationType = "post_liked"
	FOLLOWED   NotificationType = "followed"
	REPLIED    NotificationType = "replied"
)

List of NotificationType

type Post

type Post struct {
	Uuid       string     `json:"uuid"`
	Text       string     `json:"text,omitempty"`
	Draft      bool       `json:"draft"`
	Visibility Visibility `json:"visibility,omitempty"`
	CreatedAt  time.Time  `json:"created_at"`
	User       User       `json:"user"`
}

func DecodeMessageToPost

func DecodeMessageToPost(message []byte) (*Post, error)

type PostLike

type PostLike struct {
	Post Post `json:"post"`

	User User `json:"user"`
}

func DecodeMessageToPostLike

func DecodeMessageToPostLike(message []byte) (*PostLike, error)

type Reply added in v0.1.3

type Reply struct {
	Uuid      string    `json:"uuid"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	Post      Post      `json:"post"`
	Text      string    `json:"text"`
	User      User      `json:"user"`
}

func DecodeMessageToReply added in v0.1.3

func DecodeMessageToReply(message []byte) (*Reply, error)

type Session added in v0.1.10

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,omitempty"`
	Name       string `json:"name,omitempty"`
	ProfilePic string `json:"profile_pic,omitempty"`
	IsBanned   bool   `json:"is_banned,omitempty"`
}

func DecodeMessageToUser

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

type Visibility

type Visibility string
const (
	PUBLIC    Visibility = "public"
	FOLLOWING Visibility = "following"
	PRIVATE   Visibility = "private"
)

List of Visibility

Jump to

Keyboard shortcuts

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