api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 18 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, storage storage.Storage, 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
}

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

func NewHTTPHandler

func NewHTTPHandler(handler web.Handler) *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"`
	Security          Security `mapstructure:"security"`
	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
Package catalog contains logic for the Service Manager aggregated catalog API
Package catalog contains logic for the Service Manager aggregated catalog API
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

Jump to

Keyboard shortcuts

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