web

package
v0.0.0-...-3b5879d Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(h http.Handler) http.Handler

func Router

func Router() *mux.Router

Router returns mux.Router with all paths served

Types

type AuthClient

type AuthClient struct {
	Client        *oidc.Client
	AllowedGroups []string
	Token         string
}

AuthClient handles webhook authentication

func NewAuthClient

func NewAuthClient() (*AuthClient, error)

NewAuthClient creates a webhook authentication client using tokenfile defined environment 'config.Env.TokenFile' configuration. It uses `config.Env.OIDCAllowedGroups` envrionment configuration to allow access sepecific clients

func (*AuthClient) Authenticate

func (a *AuthClient) Authenticate(token string) bool

Authenticate parse the jwt token provided as parameter to authenticate if the token is in jwt claims and request is comingß from authenticated groups the function will return true

type DeployRequest

type DeployRequest struct {
	Name        string `json:"name"`
	Application string `json:"application,omitempty"`
	Version     string
}

DeployRequest represents POST request body to perform deployments.

  • Name of the service to update
  • Application image part (full construct from util.DockerImage )
  • Version application version

func ParseDeployRequest

func ParseDeployRequest(body io.Reader) (*DeployRequest, error)

ParseDeployRequest returns DeployRequest struct based on HTTP request body

type StatusPods

type StatusPods struct {
	Pods []bitesize.Pod `json:"pods,omitempty"`
}

type StatusReplicas

type StatusReplicas struct {
	Available int `json:"available"`
	UpToDate  int `json:"up_to_date"`
	Desired   int `json:"desired"`
}

type StatusResponse

type StatusResponse struct {
	EnvironmentName string          `json:"environment"`
	Namespace       string          `json:"namespace"`
	Services        []StatusService `json:"services"`
}

type StatusService

type StatusService struct {
	Name       string         `json:"name"`
	Version    string         `json:"version,omitempty"`
	URL        string         `json:"external_url,omitempty"`
	DeployedAt string         `json:"deployed_at,omitempty"`
	Replicas   StatusReplicas `json:"replicas,omitempty"`
	Status     string         `json:"status,omitempty"`
}

Jump to

Keyboard shortcuts

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