Documentation
¶
Index ¶
- type Chat
- type ChatMessage
- type ChatMessageRepository
- type ChatWithUsers
- type Duration
- type ErrorDescription
- type Forum
- type JSONtype
- type Message
- type Messages
- type Post
- type PostArray
- type RequestResult
- type Response
- type Result
- type ResultFunc
- type SessionToken
- type Thread
- type User
- type UserInGroup
- type Vote
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 ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Chat) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Chat) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Chat) UnmarshalJSON ¶
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 ¶
Duration override time.Duration for json marshalling/unmarshalling
func (Duration) MarshalJSON ¶
MarshalJSON marshal Duration to Duration
func (*Duration) UnmarshalJSON ¶
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 Message ¶
type Message struct {
Message string `json:"message,omitempty"`
}
func (Message) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Message) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Message) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Message) UnmarshalJSON ¶
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 ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Messages) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Messages) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Messages) UnmarshalJSON ¶
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 RequestResult ¶
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 ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Response) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Response) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Response) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Result ¶
Result is the query result with detailed explanation
func (Result) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Result) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Result) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Result) UnmarshalJSON ¶
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 ¶
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