Help us shape the future of Go! Take the 2026 Go Developer Survey

core

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecorateHandler

func DecorateHandler(pFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func HandlePanic

func HandlePanic(pRes http.ResponseWriter, pReq *http.Request)

func InitLogger

func InitLogger(pLevel string)

func LogRequestHandler

func LogRequestHandler(pRes http.ResponseWriter, pReq *http.Request)

func LogResponseHandler

func LogResponseHandler(pRes http.ResponseWriter, pReq *http.Request)

func NewCCCli

func NewCCCli(pUrl string, pToken string, pSkipVerify bool) (*cfclient.Client, error)

func WrapDefer

func WrapDefer(pFunc func(http.ResponseWriter, *http.Request), pDefer func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func WrapHandler

func WrapHandler(pDecorator func(http.ResponseWriter, *http.Request), pFunc func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request)

func WriteJson

func WriteJson(pWriter http.ResponseWriter, pObj interface{})

func WriteJsonError

func WriteJsonError(pWriter http.ResponseWriter, pStatus int, pCode int, pErr error)

Types

type AppConfig

type AppConfig struct {
	ConfigFile       string
	UaaClientName    string `json:"uaa-client"         cloud:"uaa-client"`
	UaaClientSecret  string `json:"uaa-secret"         cloud:"uaa-secret"`
	UaaEndPoint      string `json:"uaa-url"            cloud:"uaa-url"`
	UaaSkipVerify    bool   `json:"uaa-skip-verify"    cloud:"uaa-skip-verify"`
	CCEndPoint       string `json:"cc-url"             cloud:"cc-url"`
	CCSkipVerify     bool   `json:"cc-skip-verify"     cloud:"cc-skip-verify"`
	HttpCert         string `json:"http-cert"          cloud:"http-cert"`
	HttpKey          string `json:"http-key"           cloud:"http-key"`
	HttpPort         int    `json:"http-port"          cloud:"http-port"`
	LogLevel         string `json:"log-level"          cloud:"log-level"`
	MailFrom         string `json:"mail-from"          cloud:"mail-from"`
	MailDry          bool   `json:"mail-dry"           cloud:"mail-dry"`
	MailCc           MailCC `json:"mail-cc"            cloud:"mail-cc"`
	MailTag          string `json:"mail-tag"           cloud:"mail-tag"`
	MailRateCount    int    `json:"mail-rate-count"    cloud:"mail-rate-count"`
	MailRateDuration int    `json:"mail-rate-duration" cloud:"mail-rate-duration"`
	ReloadTemplates  bool   `json:"reload-templates"   cloud:"reload-templates"`
	NbMaxGetParams   int    `json:"nb-max-get-params"  cloud:"nb-max-get-params"`
	Version          bool
}

func NewAppConfig

func NewAppConfig() AppConfig

type CFClient

type CFClient interface {
	ListSpaces() ([]cfclient.Space, error)
	ListUsersByQuery(url.Values) (cfclient.Users, error)
	ListServices() ([]cfclient.Service, error)
	ListBuildpacks() ([]cfclient.Buildpack, error)
	ListOrgs() ([]cfclient.Org, error)
	ListSpacesByQuery(url.Values) ([]cfclient.Space, error)
	ListAppsByQuery(query url.Values) ([]cfclient.App, error)
	// ListServicesByQuery(query url.Values) ([]cfclient.Service, error)
	ListServiceInstancesByQuery(query url.Values) ([]cfclient.ServiceInstance, error)
	ListServiceBindingsByQuery(query url.Values) ([]cfclient.ServiceBinding, error)
}

func NewCCCliFromRequest

func NewCCCliFromRequest(pUrl string, pReq *http.Request, pSkipVerify bool) (CFClient, error)

type HttpError

type HttpError struct {
	Error  error
	Status int
	Code   int
}

func NewHttpError

func NewHttpError(pErr error, pStatus int, pCode int) HttpError

type MailCC

type MailCC []string

func (*MailCC) Set

func (self *MailCC) Set(pVal string) error

func (*MailCC) String

func (self *MailCC) String() string

type UaaCli

type UaaCli struct {
	Client   uaaclient.Client
	Endpoint string
	Token    string
}

func NewUaaCli

func NewUaaCli(pConf *AppConfig) (*UaaCli, error)

func (*UaaCli) GetUserList

func (self *UaaCli) GetUserList() ([]UaaUser, error)

type UaaUser

type UaaUser struct {
	Id        string `json:"id"`
	FirstName string `json:"firstname"`
	LastName  string `json:"lastname"`
	Email     string `json:"email"`
}

Jump to

Keyboard shortcuts

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