api

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 21 Imported by: 3

Documentation

Overview

Package api contains logic for building the Service Manager API business logic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, repository storage.Repository, settings *Settings, encrypter security.Encrypter) (*web.API, error)

New returns the minimum set of REST APIs needed for the Service Manager

Types

type HTTPHandler

type HTTPHandler struct {
	Handler web.Handler
	// contains filtered or unexported fields
}

HTTPHandler converts a pkg/web.Handler and pkg/web.HandlerFunc to a standard http.Handler

func NewHTTPHandler

func NewHTTPHandler(handler web.Handler, requestBodyMaxSize int) *HTTPHandler

NewHTTPHandler creates a new HTTPHandler from the provided web.Handler

func (*HTTPHandler) Handle

func (h *HTTPHandler) Handle(req *web.Request) (resp *web.Response, err error)

Handle implements the web.Handler interface

func (*HTTPHandler) ServeHTTP

func (h *HTTPHandler) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP implements the http.Handler interface and allows wrapping web.Handlers into http.Handlers

type Security

type Security struct {
	// EncryptionKey is the encryption key from the environment
	EncryptionKey string `mapstructure:"encryption_key"`
}

Security is the configuration used for the encryption of data

func (*Security) Validate

func (s *Security) Validate() error

Validate validates the API Security settings

type Settings

type Settings struct {
	TokenIssuerURL    string `mapstructure:"token_issuer_url"`
	ClientID          string `mapstructure:"client_id"`
	SkipSSLValidation bool   `mapstructure:"skip_ssl_validation"`
}

Settings type to be loaded from the environment

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings returns default values for API settings

func (*Settings) Validate

func (s *Settings) Validate() error

Validate validates the API settings

Directories

Path Synopsis
Package broker contains logic for building the Service Manager Broker Management API
Package broker contains logic for building the Service Manager Broker Management API
authn/oauth
Package oauth contains logic for setting up an Open ID Connect authenticator
Package oauth contains logic for setting up an Open ID Connect authenticator
Package healthcheck contains logic for the Service Manager healthcheck API
Package healthcheck contains logic for the Service Manager healthcheck API
Package info contains logic for the Service Manager info API
Package info contains logic for the Service Manager info API
Package osb contains logic for building the Service Manager OSB API
Package osb contains logic for building the Service Manager OSB API
Package platform contains logic for the Service Manager Platform Management API
Package platform contains logic for the Service Manager Platform Management API
Package service_offering contains logic for building the Service Manager service offerings API
Package service_offering contains logic for building the Service Manager service offerings API
Package service_offering contains logic for building the Service Manager service plans API
Package service_offering contains logic for building the Service Manager service plans API

Jump to

Keyboard shortcuts

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