structs

package
v0.0.0-...-b5cf0c5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port        string `json:"port"`
	AppEnv      string `json:"app_env"`
	MongoURI    string `json:"mongo_uri"`
	DBName      string `json:"db_name"`
	TokenSecret string `json:"token_secret"`
}

type LogItem

type LogItem struct {
	Timestamp string  `json:"timestamp"`
	ID        string  `json:"id"`
	Level     string  `json:"level"`
	Payload   Payload `json:"payload"`
}

func (LogItem) String

func (l LogItem) String() string

type Message

type Message struct {
	Data []byte `json:"data"`
	Room string `json:"room"`
	User string `json:"user"`
}

type Payload

type Payload struct {
	Method  string            `json:"method"`
	Status  int               `json:"status"`
	Path    string            `json:"path"`
	IP      string            `json:"ip"`
	Headers map[string]string `json:"headers"`
	Body    interface{}       `json:"body"`
}

func (Payload) Raw

func (p Payload) Raw() string

func (Payload) String

func (p Payload) String() string

type Room

type Room struct {
	Id    string `json:"id"`
	Users []User `json:"users"`
}

type Subscription

type Subscription struct {
	Conn *websocket.Conn `json:"conn"`
	Room string          `json:"room"`
	User string          `json:"user"`
}

type User

type User struct {
	ID     any           `json:"_id"`
	Name   string        `json:"username"`
	Email  string        `json:"email" validate:"required,email"`
	Avatar string        `json:"avatar" validate:"omitempty,url"`
	Token  string        `json:"token"`
	Roles  []interface{} `json:"roles"`
}

Jump to

Keyboard shortcuts

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