views

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderAccount

func RenderAccount(w http.ResponseWriter, r *http.Request, user *models.User)

func RenderBlankResponse

func RenderBlankResponse(w http.ResponseWriter, r *http.Request)

func RenderCoupon

func RenderCoupon(w http.ResponseWriter, r *http.Request, coupon *models.Coupon)

func RenderCoupons

func RenderCoupons(w http.ResponseWriter, r *http.Request, coupons []*models.Coupon)

func RenderDataResponse

func RenderDataResponse(w http.ResponseWriter, r *http.Request, view interface{})

func RenderErrorResponse

func RenderErrorResponse(w http.ResponseWriter, r *http.Request, err error)

func RenderMessages

func RenderMessages(w http.ResponseWriter, r *http.Request, messages []*models.Message)

func RenderPacket

func RenderPacket(w http.ResponseWriter, r *http.Request, packet *models.Packet)

func RenderPacketPreparation

func RenderPacketPreparation(w http.ResponseWriter, r *http.Request, participantsCount int64, assets []*models.Asset)

func RenderUserView

func RenderUserView(w http.ResponseWriter, r *http.Request, user *models.User)

func RenderUsersView

func RenderUsersView(w http.ResponseWriter, r *http.Request, users []*models.User)

Types

type AccountView

type AccountView struct {
	UserView
	AuthenticationToken string `json:"authentication_token"`
	TraceId             string `json:"trace_id"`
	State               string `json:"state"`
}

type AssetView

type AssetView struct {
	Type     string `json:"type"`
	AssetId  string `json:"asset_id"`
	Symbol   string `json:"symbol"`
	Name     string `json:"name"`
	IconURL  string `json:"icon_url"`
	Balance  string `json:"balance"`
	PriceBTC string `json:"price_btc"`
	PriceUSD string `json:"price_usd"`
}

type CouponView

type CouponView struct {
	Type      string    `json:"type"`
	CouponId  string    `json:"coupon_id"`
	Code      string    `json:"code"`
	FullName  string    `json:"full_name"`
	CreatedAt time.Time `json:"created_at"`
}

type MessageView

type MessageView struct {
	Type      string    `json:"type"`
	MessageId string    `json:"message_id"`
	Category  string    `json:"category"`
	Data      string    `json:"data"`
	FullName  string    `json:"full_name"`
	CreatedAt time.Time `json:"created_at"`
}

type PacketView

type PacketView struct {
	Type            string            `json:"type"`
	PacketId        string            `json:"packet_id"`
	User            UserView          `json:"user"`
	Asset           AssetView         `json:"asset"`
	Amount          string            `json:"amount"`
	Greeting        string            `json:"greeting"`
	TotalCount      int64             `json:"total_count"`
	RemainingCount  int64             `json:"remaining_count"`
	RemainingAmount string            `json:"remaining_amount"`
	OpenedCount     int64             `json:"opened_count"`
	OpenedAmount    string            `json:"opened_amount"`
	State           string            `json:"state"`
	Participants    []ParticipantView `json:"participants"`
}

type ParticipantView

type ParticipantView struct {
	Type      string    `json:"type"`
	UserId    string    `json:"user_id"`
	FullName  string    `json:"full_name"`
	AvatarURL string    `json:"avatar_url"`
	Amount    string    `json:"amount"`
	CreatedAt time.Time `json:"created_at"`
}

type PreparationView

type PreparationView struct {
	Conversation struct {
		PariticipantsCount int64 `json:"participants_count"`
	} `json:"conversation"`
	Assets []AssetView `json:"assets"`
}

type ResponseView

type ResponseView struct {
	Data  interface{} `json:"data,omitempty"`
	Error error       `json:"error,omitempty"`
	Prev  string      `json:"prev,omitempty"`
	Next  string      `json:"next,omitempty"`
}

type UserView

type UserView struct {
	Type           string `json:"type"`
	UserId         string `json:"user_id"`
	IdentityNumber string `json:"identity_number"`
	FullName       string `json:"full_name"`
	AvatarURL      string `json:"avatar_url"`
	SubscribedAt   string `json:"subscribed_at"`
	Role           string `json:"role"`
}

Jump to

Keyboard shortcuts

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