deployer

package
v0.0.0-...-fdd9b93 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET    = "get"
	POST   = "post"
	PATCH  = "patch"
	DELETE = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployer

type Deployer struct {
	Config        *config.DeployerSettingsConfig
	LocalConfig   *config.LocalConfig
	BlockingStart bool

	Logger            *zap.SugaredLogger
	Router            *chi.Mux
	Listener          net.Listener
	IBPOperatorClient *ibpoperator.Client
	K8SClient         *kube.Kube

	CA       *ca.CA
	Peer     *peer.Peer
	Orderer  *orderer.Orderer
	Operator *operator.Operator
	// contains filtered or unexported fields
}

func New

func New(config *config.DeployerSettingsConfig, localConfig *config.LocalConfig, blockingStart bool) *Deployer

New is a hook that is called with the Options the program is run with. Deployer is the place where you will initialize your Deployer with the parameters passed in.

func (*Deployer) AddHSTSHeaderMiddleware

func (d *Deployer) AddHSTSHeaderMiddleware(next http.Handler) http.Handler

func (*Deployer) BasicAuth

func (d *Deployer) BasicAuth(r *http.Request) (string, error)

func (*Deployer) BasicAuthMiddleware

func (d *Deployer) BasicAuthMiddleware(next http.Handler) http.Handler

func (*Deployer) ClusterVersionHandler

func (d *Deployer) ClusterVersionHandler(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

ClusterVersionHandler will handle getting kubernetes cluster version

func (*Deployer) Create

func (d *Deployer) Create(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) CreateEndpoint

func (d *Deployer) CreateEndpoint() func(http.ResponseWriter, *http.Request)

func (*Deployer) CreateListener

func (d *Deployer) CreateListener(address string, tlsConfig *tls.Config) error

func (*Deployer) Delete

func (d *Deployer) Delete(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) DeleteEndpoint

func (d *Deployer) DeleteEndpoint() func(http.ResponseWriter, *http.Request)

func (*Deployer) GetAll

func (d *Deployer) GetAll(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) GetAllEndpoint

func (d *Deployer) GetAllEndpoint() func(http.ResponseWriter, *http.Request)

func (*Deployer) GetEndpointSection

func (d *Deployer) GetEndpointSection() func(http.ResponseWriter, *http.Request)

func (*Deployer) GetSection

func (d *Deployer) GetSection(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) Init

func (d *Deployer) Init() error

func (*Deployer) K8sVersionEndpoint

func (d *Deployer) K8sVersionEndpoint() func(http.ResponseWriter, *http.Request)

K8sVersionEndpoint returns an endpoint type that is responsible for handling getting kuberenetes cluster version

func (*Deployer) PatchEndpointSection

func (d *Deployer) PatchEndpointSection() func(http.ResponseWriter, *http.Request)

func (*Deployer) PatchSection

func (d *Deployer) PatchSection(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) PrecreateOrderer

func (d *Deployer) PrecreateOrderer(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) PrecreatedOrdererEndpoint

func (d *Deployer) PrecreatedOrdererEndpoint() func(http.ResponseWriter, *http.Request)

func (*Deployer) Serve

func (d *Deployer) Serve()

func (*Deployer) ServeHTTP

func (d *Deployer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Deployer) Stop

func (d *Deployer) Stop() error

func (*Deployer) UpdateEndpointSection

func (d *Deployer) UpdateEndpointSection() func(http.ResponseWriter, *http.Request)

func (*Deployer) UpdateSection

func (d *Deployer) UpdateSection(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) Version

func (d *Deployer) Version(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

func (*Deployer) VersionEndpoint

func (d *Deployer) VersionEndpoint() func(http.ResponseWriter, *http.Request)

type Endpoint

type Endpoint struct {
	// Handler is the handler function for this endpoint
	Handler func(w http.ResponseWriter, r *http.Request) (interface{}, int, error)

	Logger *zap.SugaredLogger
}

Endpoint represents a particular endpoint

func NewEndpoint

func NewEndpoint(handler func(http.ResponseWriter, *http.Request) (interface{}, int, error), logger *zap.Logger) *Endpoint

func (*Endpoint) ServeHTTP

func (se *Endpoint) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP encapsulates the call to underlying Handlers to handle the request and return the response with a proper HTTP status code

type Errors

type Errors struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

Errors represent an errors response

type HTTPResponseWriter

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

func NewHTTPResponseWriter

func NewHTTPResponseWriter(r *http.Request, w http.ResponseWriter, se *Endpoint) *HTTPResponseWriter

func (*HTTPResponseWriter) Header

func (hrw *HTTPResponseWriter) Header() http.Header

Header returns the header map that will be sent by WriteHeader.

func (*HTTPResponseWriter) Write

func (hrw *HTTPResponseWriter) Write(buf []byte) (int, error)

Write writes the data to the connection as part of an HTTP reply.

func (*HTTPResponseWriter) WriteHeader

func (hrw *HTTPResponseWriter) WriteHeader(scode int)

WriteHeader sends an HTTP response header with status code.

Directories

Path Synopsis
components
ca
ca/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
operator/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
orderer/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.
peer/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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