api

package
v0.2.52 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAGE_DEFAULT     = 0
	PER_PAGE_DEFAULT = 10
	PER_PAGE_MAXIMUM = 200
)

Variables

This section is empty.

Functions

func ApiCustomClaimsRequired

func ApiCustomClaimsRequired(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler

func ApiHandler

func ApiHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler

func AppHandler

func AppHandler(h func(*Context, http.ResponseWriter, *http.Request)) http.Handler

func BindJson

func BindJson(data io.Reader, dest interface{}) error

func Handle404

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

func HandleEtag

func HandleEtag(etag string, routeName string, w http.ResponseWriter, r *http.Request) bool

func InitApi

func InitApi()

func InitOauth

func InitOauth()

func InitRouter

func InitRouter()

func InitSystem

func InitSystem()

func InitUser

func InitUser()

func IsApiCall

func IsApiCall(r *http.Request) bool

func NewInvalidParamError

func NewInvalidParamError(parameter string) *model.AppError

func NewInvalidUrlParamError

func NewInvalidUrlParamError(parameter string) *model.AppError

func RenderJson

func RenderJson(w http.ResponseWriter, o interface{})

func ReturnStatusOK

func ReturnStatusOK(w http.ResponseWriter)

Types

type ApiParams

type ApiParams struct {
	UserId   string
	Email    string
	Username string
	Region   string
	Term     string
	Service  string
	Mobile   string
	Page     int
	PerPage  int
}

func ApiParamsFromRequest

func ApiParamsFromRequest(r *http.Request) *ApiParams

type Context

type Context struct {
	CustomClaims model.CustomClaims
	TokenString  string
	Params       *ApiParams
	Err          *model.AppError
	T            goi18n.TranslateFunc
	RequestId    string
	IpAddress    string
	Path         string
	// contains filtered or unexported fields
}

func (*Context) CustomClaimsRequired

func (c *Context) CustomClaimsRequired()

func (*Context) GetSiteURLHeader

func (c *Context) GetSiteURLHeader() string

func (*Context) IsSystemAdmin

func (c *Context) IsSystemAdmin() bool

func (*Context) LogDebug

func (c *Context) LogDebug(err *model.AppError)

func (*Context) LogError

func (c *Context) LogError(err *model.AppError)

func (*Context) RemoveCustomClaimsCookie

func (c *Context) RemoveCustomClaimsCookie(w http.ResponseWriter, r *http.Request)

func (*Context) RequireService

func (c *Context) RequireService() *Context

func (*Context) RequireUserId

func (c *Context) RequireUserId() *Context

func (*Context) SetInvalidParam

func (c *Context) SetInvalidParam(parameter string)

func (*Context) SetInvalidUrlParam

func (c *Context) SetInvalidUrlParam(parameter string)

func (*Context) SetPermissionError

func (c *Context) SetPermissionError(permission *model.Permission)

func (*Context) SetSiteURLHeader

func (c *Context) SetSiteURLHeader(url string)

type Routes

type Routes struct {
	Root    *mux.Router // ”
	ApiRoot *mux.Router // 'sso'

	Users *mux.Router // 'sso/users'
	User  *mux.Router // 'sso/users/{user_id:[A-Za-z0-9]+}'
}
var BaseRoutes *Routes

Jump to

Keyboard shortcuts

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