httpapi

package
v0.0.0-...-a87fba8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSecretRef = types.NamespacedName{
	Name:      "pipelines-app-gitops",
	Namespace: "pipelines-app-delivery",
}

DefaultSecretRef is the name looked up if none is provided in the URL.

Functions

func AuthToken

func AuthToken(ctx context.Context) string

AuthToken gets the auth token from the context.

func AuthenticationMiddleware

func AuthenticationMiddleware(next http.Handler) http.Handler

AuthenticationMiddleware wraps an http.Handler and checks for the presence of an 'Authorization' header with a bearer token.

This token is placed into the context, and is accessible via the AuthToken function.

No attempt to validate the actual token is made.

func WithAuthToken

func WithAuthToken(ctx context.Context, t string) context.Context

WithAuthToken sets the auth token into the context.

Types

type APIRouter

type APIRouter struct {
	*httprouter.Router
	// contains filtered or unexported fields
}

APIRouter is an HTTP API for accessing app configurations.

func NewRouter

NewRouter creates and returns a new APIRouter.

func (*APIRouter) GetApplication

func (a *APIRouter) GetApplication(w http.ResponseWriter, r *http.Request)

GetApplication fetches an application within a specific environment.

Expects the

func (*APIRouter) GetApplicationDetails

func (a *APIRouter) GetApplicationDetails(w http.ResponseWriter, r *http.Request)

func (*APIRouter) GetApplicationHistory

func (a *APIRouter) GetApplicationHistory(w http.ResponseWriter, r *http.Request)

func (*APIRouter) GetPipelines

func (a *APIRouter) GetPipelines(w http.ResponseWriter, r *http.Request)

GetPipelines fetches and returns the pipeline body.

func (*APIRouter) ListApplications

func (a *APIRouter) ListApplications(w http.ResponseWriter, r *http.Request)

type RevisionMeta

type RevisionMeta struct {
	Author   string `json:"author"`
	Message  string `json:"message"`
	Revision string `json:"revision"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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