api

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RN_Preflight                   = "preflight"
	RN_HealthCheck                 = "healthCheck"
	RN_ListNamespaces              = "listNamespaces"
	RN_AddNamespace                = "addNamespace"
	RN_DeleteNamespace             = "deleteNamespace"
	RN_NamespaceEvent              = "namespaceEvent"
	RN_ListSecrets                 = "listSecrets"
	RN_CreateSecret                = "createSecret"
	RN_DeleteSecret                = "deleteSecret"
	RN_ListRegistries              = "listRegistries"
	RN_CreateRegistry              = "createRegistry"
	RN_DeleteRegistry              = "deleteRegistry"
	RN_GetWorkflowMetrics          = "getWorkflowMetrics"
	RN_ListWorkflows               = "listWorkflows"
	RN_GetWorkflow                 = "getWorkflow"
	RN_UpdateWorkflow              = "updateWorkflow"
	RN_ToggleWorkflow              = "toggleWorkflow"
	RN_CreateWorkflow              = "createWorkflow"
	RN_DeleteWorkflow              = "deleteWorkflow"
	RN_DownloadWorkflow            = "downloadWorkflow"
	RN_ExecuteWorkflow             = "executeWorkflow"
	RN_ListWorkflowInstances       = "listWorkflowInstances"
	RN_ListInstances               = "listInstances"
	RN_GetInstance                 = "getInstance"
	RN_CancelInstance              = "cancelInstance"
	RN_GetInstanceLogs             = "getInstanceLogs"
	RN_ListActionTemplateFolders   = "listActionTemplateFolders"
	RN_ListActionTemplates         = "listActionTemplates"
	RN_GetActionTemplate           = "getActionTemplate"
	RN_ListWorkflowTemplateFolders = "listWorkflowTemplateFolders"
	RN_ListWorkflowTemplates       = "listWorkflowTemplates"
	RN_GetWorkflowTemplate         = "getWorkflowTemplate"
	RN_ListWorkflowVariables       = "listWorkflowVariables"
	RN_GetWorkflowVariable         = "getWorkflowVariable"
	RN_SetWorkflowVariable         = "setWorkflowVariable"
	RN_ListNamespaceVariables      = "listNamespaceVariables"
	RN_GetNamespaceVariable        = "getNamespaceVariable"
	RN_GetNamespaceLogs            = "getNamespaceLogs"
	RN_SetNamespaceVariable        = "setNamespaceVariable"
	RN_JQPlayground                = "jqPlayground"
)

RN = Route Name

View Source
const (
	// GRPCCommandTimeout : timeout for grpc function calls
	GRPCCommandTimeout = 90 * time.Second
)
View Source
const (

	// GenericErrorCode - Reserved status code for generic non grpc errors
	GenericErrorCode codes.Code = 50
)

Variables

Functions

func ConvertGRPCStatusCodeToHTTPCode added in v0.2.6

func ConvertGRPCStatusCodeToHTTPCode(code codes.Code) int

ConvertGRPCStatusCodeToHTTPCode - Convert Grpc Code errors to http response codes

func CtxDeadline

func CtxDeadline(ctx context.Context) (context.Context, context.CancelFunc)

CtxDeadline defines default request deadline

func ErrResponse

func ErrResponse(w http.ResponseWriter, err error)

ErrResponse creates error based on grpc error

Types

type Config

type Config struct {
	Ingress struct {
		Endpoint string
		TLS      bool
	}

	Server struct {
		Bind string
	}

	Templates struct {
		WorkflowTemplateDirectories []NamedDirectory
		ActionTemplateDirectories   []NamedDirectory
	}
}

Config ..

func ConfigFromEnv

func ConfigFromEnv() (*Config, error)

ConfigFromEnv reads API configuration from env variables

func ConfigFromFile

func ConfigFromFile(cfgPath string) (*Config, error)

ConfigFromFile reads API configuration from file

func Configure

func Configure() (*Config, error)

Configure reads config from file or env

type ErrObject

type ErrObject struct {
	Code    codes.Code
	Message string
}

ErrObject for grpc

func GenerateErrObject added in v0.2.6

func GenerateErrObject(err error) *ErrObject

GenerateErrObject - Unwrap grpc errors into ErrorObject

type GithubFileInfo

type GithubFileInfo struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Sha         string `json:"sha"`
	Size        int    `json:"size"`
	URL         string `json:"url"`
	HTMLURL     string `json:"html_url"`
	GitURL      string `json:"git_url"`
	DownloadURL string `json:"download_url"`
	Type        string `json:"type"`
	Links       struct {
		Self string `json:"self"`
		Git  string `json:"git"`
		HTML string `json:"html"`
	} `json:"_links"`
}

GithubDirectoryInfo ..

type Handler

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

type JQQuery

type JQQuery struct {
	Input map[string]interface{} `json:"input"`
	Query string                 `json:"query"`
}

type NameDataTuple

type NameDataTuple struct {
	Name string `json:"name"`
	Data string `json:"data,omitempty"`
}

type NamedDirectory

type NamedDirectory struct {
	Label     string
	Directory string
}

type RequestStatus

type RequestStatus struct {
	StatusCode int
	Message    string
}

type Server

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

Server ..

func NewServer

func NewServer(cfg *Config) (*Server, error)

NewServer returns new API server

func (*Server) IngressClient

func (s *Server) IngressClient() ingress.DirektivIngressClient

IngressClient returns client to backend

func (*Server) Router

func (s *Server) Router() *mux.Router

Router returns mux router

func (*Server) Start

func (s *Server) Start() error

Start starts the API server

Jump to

Keyboard shortcuts

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