api

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RN_Preflight                   = "Preflight"
	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_JQPlayground                = "JQPlayground"
)

RN = Route Name

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

Variables

Functions

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    int
	Message string
}

ErrObject for grpc

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