views

package
v0.0.0-...-84af44b Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderBlankResponse

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

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 RenderUserWithAuthentication

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

Types

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 {
	UserId    string `json:"user_id"`
	SessionId string `json:"session_id"`
	FullName  string `json:"full_name"`
	Email     string `json:"email,omitempty"`
	Phone     string `json:"phone,omitempty"`
	MixinId   string `json:"mixin_id,omitempty"`
}

Jump to

Keyboard shortcuts

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