models

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	ID       int32       `json:"id"`
	Type     int32       `json:"type"`
	TypeID   int32       `json:"type_id"`
	Messages []*Messages `json:"messages"`
}

func (Chat) MarshalEasyJSON

func (v Chat) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Chat) MarshalJSON

func (v Chat) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Chat) UnmarshalEasyJSON

func (v *Chat) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Chat) UnmarshalJSON

func (v *Chat) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ChatMessage

type ChatMessage struct {
	ID     int32        `json:"id"`
	Answer *ChatMessage `json:"answer"`
	Text   string       `json:"text"`
	From   *User        `json:"from"`
	To     *User        `json:"to"`
	ChatID int32        `json:"chat_id"`
	Time   time.Time    `json:"time"`
	Edited bool         `json:"edited"`
}

func (ChatMessage) MarshalEasyJSON

func (v ChatMessage) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ChatMessage) MarshalJSON

func (v ChatMessage) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ChatMessage) UnmarshalEasyJSON

func (v *ChatMessage) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ChatMessage) UnmarshalJSON

func (v *ChatMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ChatMessageRepository

type ChatMessageRepository interface {
	Get() *ChatMessage
	Set(*ChatMessage)
}

type ChatWithUsers

type ChatWithUsers struct {
	Type   int32   `json:"type"`
	TypeID int32   `json:"type_id"`
	Users  []*User `json:"users"`
}

func (ChatWithUsers) MarshalEasyJSON

func (v ChatWithUsers) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ChatWithUsers) MarshalJSON

func (v ChatWithUsers) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ChatWithUsers) UnmarshalEasyJSON

func (v *ChatWithUsers) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ChatWithUsers) UnmarshalJSON

func (v *ChatWithUsers) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Duration

type Duration struct {
	time.Duration
}

Duration override time.Duration for json marshalling/unmarshalling

func (*Duration) Init

func (d *Duration) Init(t time.Duration)

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() (b []byte, err error)

MarshalJSON marshal Duration to Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON unmarshal JSON to Duration

type ErrorDescription

type ErrorDescription struct {
	Error            string `json:"error" example:"unsupported_grant_type" `
	ErrorDescription string `json:"error_description" example:"The authorization grant type is not supported by the authorization server" `
}

ErrorDescription represents OAUTH2 Error

type Forum

type Forum struct {
	Posts   int    `json:"posts,omitempty"`
	Slug    string `json:"slug,omitempty"`
	Threads int    `json:"threads,omitempty"`
	Title   string `json:"title,omitempty"`
	User    string `json:"user,omitempty"`
}

type JSONtype

type JSONtype interface {
	MarshalJSON() ([]byte, error)
	UnmarshalJSON(data []byte) error
}

JSONtype is interface to be sent by json

type Message

type Message struct {
	Message string `json:"message,omitempty"`
}

func (Message) MarshalEasyJSON

func (v Message) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Message) MarshalJSON

func (v Message) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Message) UnmarshalEasyJSON

func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Message) UnmarshalJSON

func (v *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Messages

type Messages struct {
	Messages    []*ChatMessage `json:"messages"`
	BlockSize   int32          `json:"size"`
	BlockAmount int32          `json:"amount"`
	BlockNumber int32          `json:"number"`
}

func (Messages) MarshalEasyJSON

func (v Messages) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Messages) MarshalJSON

func (v Messages) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Messages) UnmarshalEasyJSON

func (v *Messages) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Messages) UnmarshalJSON

func (v *Messages) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Post

type Post struct {
	Author   string `json:"author,omitempty"`
	Created  string `json:"created,omitempty"`
	Forum    string `json:"forum,omitempty"`
	Id       int    `json:"id,omitempty"`
	IsEdited bool   `json:"isEdited,omitempty"`
	Message  string `json:"message,omitempty"`
	Parent   int    `json:"parent,omitempty"`
	Thread   int    `json:"thread,omitempty"`
	Path     string `json:"path,omitempty"`
	Branch   string `json:"branch,omitempty"`
}

type PostArray

type PostArray struct {
	// contains filtered or unexported fields
}

type RequestResult

type RequestResult struct {
	Code int
	Send JSONtype
	Err  error
}

type Response

type Response struct {
	Type    string      `json:"type"`
	Message string      `json:"message,omitempty"`
	Value   interface{} `json:"value"`
}

Response is game struct, that frontend is waiting from backend

func (Response) MarshalEasyJSON

func (v Response) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Response) MarshalJSON

func (v Response) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Response) UnmarshalEasyJSON

func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Response) UnmarshalJSON

func (v *Response) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Result

type Result struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

Result is the query result with detailed explanation

func (Result) MarshalEasyJSON

func (v Result) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Result) MarshalJSON

func (v Result) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Result) UnmarshalEasyJSON

func (v *Result) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Result) UnmarshalJSON

func (v *Result) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ResultFunc

type ResultFunc func(http.ResponseWriter, *http.Request) RequestResult

type SessionToken

type SessionToken struct {
	AccessToken  string `json:"access_token" example:"123123123" `
	TokenType    string `json:"token_type"  example:"bearer" `
	ExpiresIn    int32  `json:"expires_in"  example:"86400" `
	RefreshToken string `json:"refresh_token" example:"321321321" `
}

SessionToken represents OAUTH2 token

type Thread

type Thread struct {
	Author  string `json:"author,omitempty"`
	Created string `json:"created,omitempty"`
	Forum   string `json:"forum,omitempty"`
	Id      int    `json:"id,omitempty"`
	Message string `json:"message,omitempty"`
	Slug    string `json:"slug,omitempty"`
	Title   string `json:"title,omitempty"`
	Votes   int    `json:"votes,omitempty"`
}

type User

type User struct {
	ID       int    `json:"-" db:"id"`
	About    string `json:"about,omitempty" db:"about"`
	Email    string `json:"email,omitempty" db:"email"`
	Fullname string `json:"fullname,omitempty" db:"fullname"`
	Nickname string `json:"nickname,omitempty" db:"nickname"`
}

User model

type UserInGroup

type UserInGroup struct {
	User *User `json:"user"`
	Chat *Chat `json:"chat"`
}

func (UserInGroup) MarshalEasyJSON

func (v UserInGroup) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserInGroup) MarshalJSON

func (v UserInGroup) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserInGroup) UnmarshalEasyJSON

func (v *UserInGroup) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserInGroup) UnmarshalJSON

func (v *UserInGroup) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Vote

type Vote struct {
	Nickname string `json:"nickname,omitempty"`
	Voice    int    `json:"voice,omitempty"`
	ThreadId int    `json:"threadId,omitempty"`
}

Jump to

Keyboard shortcuts

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