pages

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HANDLER_TYPE_JSON = iota
	HANDLER_TYPE_HTTP_STATUS
	HANDLER_TYPE_HTML_STRINGS
	HANDLER_TYPE_HTTP_REDIRECT
)

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonMapGeneric

type JsonMapGeneric map[string]interface{}

func (JsonMapGeneric) GetString

func (j JsonMapGeneric) GetString() (string, error)

func (JsonMapGeneric) SetErrorCode

func (j JsonMapGeneric) SetErrorCode(code string)

func (JsonMapGeneric) SetJwt

func (j JsonMapGeneric) SetJwt(jwt string)

type JsonResponse

type JsonResponse interface {
	GetString() (string, error)
	SetJwt(string)
	SetErrorCode(string)
}

type PageConfig

type PageConfig struct {
	PageName             string
	Handler              func(*RequestData)
	HandlerType          int
	RequestSource        string
	Scopes               uint64
	RequiresDBScopeCheck bool
	AcceptAnyScope       bool
	SkipCsrfCheck        bool
}

type RequestData

type RequestData struct {
	Ctx                       context.Context
	SiteConfig                *custom.Config
	UserRecord                *datastore.UserRecord
	HttpWriter                http.ResponseWriter
	HttpRequest               *http.Request
	JsonResponse              JsonResponse
	HttpStatusResponseMessage string
	HttpStatusResponseBytes   []byte
	HttpStatusResponseCode    int
	HttpRedirectDestination   string
	HttpRedirectIsPermanent   bool
	PageConfig                *PageConfig
	ExtraUrlParams            []string
	JwtRecord                 *datastore.JwtRecord
	JwtString                 string
	DeleteJwtWhenFinished     bool
}

func (*RequestData) LogError

func (rData *RequestData) LogError(format string, args ...interface{})

func (*RequestData) LogInfo

func (rData *RequestData) LogInfo(format string, args ...interface{})

func (*RequestData) OutputHtmlString

func (rData *RequestData) OutputHtmlString(msg string, args ...interface{})

func (*RequestData) OutputHttpResponse

func (rData *RequestData) OutputHttpResponse()

func (*RequestData) OutputImageJpg

func (rData *RequestData) OutputImageJpg(img *image.Image) error

func (*RequestData) OutputJsonString

func (rData *RequestData) OutputJsonString() error

func (*RequestData) SetContentType

func (rData *RequestData) SetContentType(contentType string)

func (*RequestData) SetHttpStatusResponse

func (rData *RequestData) SetHttpStatusResponse(code int, msg string, args ...interface{})

func (*RequestData) SetJsonErrorCodeResponse

func (rData *RequestData) SetJsonErrorCodeResponse(code string)

func (*RequestData) SetJsonErrorCodeWithDataResponse

func (rData *RequestData) SetJsonErrorCodeWithDataResponse(code string, jsonResponse JsonResponse)

func (*RequestData) SetJsonErrorResponse

func (rData *RequestData) SetJsonErrorResponse(jsonResponse JsonResponse)

func (*RequestData) SetJsonSuccessCodeResponse

func (rData *RequestData) SetJsonSuccessCodeResponse(code string)

func (*RequestData) SetJsonSuccessCodeWithDataResponse

func (rData *RequestData) SetJsonSuccessCodeWithDataResponse(code string, jsonResponse JsonResponse)

func (*RequestData) SetJsonSuccessResponse

func (rData *RequestData) SetJsonSuccessResponse(jsonResponse JsonResponse)

type TemplateData

type TemplateData struct {
	CacheBuster int64
	PageData    interface{}
}

Jump to

Keyboard shortcuts

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