common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootstrapArchiveDomain

func BootstrapArchiveDomain() archive.AsyncJobAdapter

func BootstrapCatalogAndArchiveDomains

func BootstrapCatalogAndArchiveDomains()

BootstrapCatalogAndArchiveDomains bootstraps all domains

func BootstrapCatalogDomain

func BootstrapCatalogDomain()

BootstrapCatalogDomain bootstraps both oauth and catalog

func BootstrapOAuthDomain

func BootstrapOAuthDomain()

BootstrapOAuthDomain only bootstraps oauth

Types

type ArgParser

type ArgParser struct {
	// contains filtered or unexported fields
}

ArgParser is a helper to read several parameters from the request

func NewArgParser

func NewArgParser(request *events.APIGatewayProxyRequest) *ArgParser

func (*ArgParser) BadRequest

func (a *ArgParser) BadRequest() (Response, error)

func (*ArgParser) HasViolations

func (a *ArgParser) HasViolations() bool

func (*ArgParser) ReadPathParameterInt

func (a *ArgParser) ReadPathParameterInt(key string) int

func (*ArgParser) ReadPathParameterString

func (a *ArgParser) ReadPathParameterString(key string) string

func (*ArgParser) ReadQueryParameterInteger

func (a *ArgParser) ReadQueryParameterInteger(key string, mandatory bool) int

type Response

func BadRequest

func BadRequest(body interface{}) (Response, error)

func InternalError

func InternalError(cause error) (Response, error)

InternalError logs the error and create a 500 error response

func NewJsonResponse

func NewJsonResponse(code int, body interface{}, headers map[string]string) (Response, error)

NewJsonResponse serialises body into JSON and create a Response containing it as body.

func NotFound

func NotFound(body interface{}) (Response, error)

func Ok

func Ok(body interface{}) (Response, error)

func ValidateRequest

func ValidateRequest(request *events.APIGatewayProxyRequest, query *oauth.AuthoriseQuery) (Response, bool)

ValidateRequest make sure authorisation is valid for the expected actions. Return [response, TRUE] when the consumer is not authorised.

Jump to

Keyboard shortcuts

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