rest

package
v0.0.0-...-5b6efc0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizationDenied

func AuthorizationDenied(w http.ResponseWriter, r *http.Request, err error)

func CheckAcceptRequestHeaderMiddleware

func CheckAcceptRequestHeaderMiddleware(mediatype string) func(http.Handler) http.Handler

func CheckContentHeaderMiddleware

func CheckContentHeaderMiddleware(contentType string) func(http.Handler) http.Handler

func ComponentCreateHandler

func ComponentCreateHandler(w http.ResponseWriter, r *http.Request, client storage.ComponentClient)

func ComponentDeleteHandler

func ComponentDeleteHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentGetHandler

func ComponentGetHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentLikeListHandler

func ComponentLikeListHandler(w http.ResponseWriter, r *http.Request, client storage.ComponentClient, kind string)

func ComponentListHandler

func ComponentListHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentPatchHandler

func ComponentPatchHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentPostHandler

func ComponentPostHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentPutHandler

func ComponentPutHandler(componentClient storage.ComponentClient) http.HandlerFunc

func ComponentVersionLikeListHandler

func ComponentVersionLikeListHandler(w http.ResponseWriter, r *http.Request, client storage.ComponentClient, kind string)

func ComponentVersionListHandler

func ComponentVersionListHandler(client storage.ComponentClient) http.HandlerFunc

func CreateWorkflowWatch

func CreateWorkflowWatch(ctx context.Context, argoclient argoclient.Interface, jobid, workspace string) (watch.Interface, error)

func CreationPathAuthorization

func CreationPathAuthorization(next http.HandlerFunc) http.HandlerFunc

func DeleteJob

func DeleteJob(ctx context.Context, storageClient storage.ComponentClient, argoClient argoclient.Interface, uid models.ComponentReference, workspace string) (models.ComponentReference, error)

func EventSaver

func EventSaver(ctx context.Context, wfi v1a1.WorkflowInterface, jobid models.ComponentReference, storageClient storage.ComponentClient)

func GetFieldnameSelector

func GetFieldnameSelector(jobname string) string

func GetWorkspaceAccess

func GetWorkspaceAccess(ctx context.Context) []workspace.Workspace

func InitializeComponent

func InitializeComponent(ctx context.Context, component models.Component) (models.Component, error)

func InitializeJob

func InitializeJob(ctx context.Context, job models.Job) (models.Job, error)

func InitializeMetadata

func InitializeMetadata(ctx context.Context, meta *models.Metadata) error

func InitializeWorkflow

func InitializeWorkflow(ctx context.Context, workflow models.Workflow) (models.Workflow, error)

func JobDeleteHandler

func JobDeleteHandler(storageClient storage.ComponentClient, argoclient argoclient.Interface) http.HandlerFunc

func JobGetHandler

func JobGetHandler(componentClient storage.ComponentClient) http.HandlerFunc

func JobStatusHandler

func JobStatusHandler(argoclient argoclient.Interface) http.HandlerFunc

func JobTerminateHandler

func JobTerminateHandler(argoClient argoclient.Interface) http.HandlerFunc

func JobsEventstreamHandler

func JobsEventstreamHandler(componentClient storage.ComponentClient, argoclient argoclient.Interface) http.HandlerFunc

func JobsListHandler

func JobsListHandler(componentClient storage.ComponentClient, argoclient argoclient.Interface) http.HandlerFunc

func JobsSubmitHandler

func JobsSubmitHandler(componentClient storage.ComponentClient, argoclient argoclient.Interface) http.HandlerFunc

func NewAuthenticationMiddleware

func NewAuthenticationMiddleware(sec auth.AuthenticationClient) mux.MiddlewareFunc

This ensures that the context is authenticated, with the appropriate User-tokens

func NewAuthorizationContext

func NewAuthorizationContext(wsclient workspace.WorkspaceClient) mux.MiddlewareFunc

This injects the workspace into the context and can be used to authorize users further down the stack

func PatchComponent

func PatchComponent(ctx context.Context, client storage.ComponentClient, component models.Component) (models.Component, error)

func PatchWorkflow

func PatchWorkflow(ctx context.Context, client storage.ComponentClient, workflow models.Workflow) (models.Workflow, error)

func PathAuthorization

func PathAuthorization(subject auth.Subject, action auth.Action, pathVariableName string, authz auth.AuthorizationClient, next http.HandlerFunc) http.HandlerFunc

func PutComponent

func PutComponent(ctx context.Context, client storage.ComponentClient, component models.Component) error

func PutWorkflow

func PutWorkflow(ctx context.Context, client storage.ComponentClient, workflow models.Workflow) error

func ReadBody

func ReadBody(r *http.Request, item any) error

try to read a json-marshalled type from the body of a request

func RegisterComponentRoutes

func RegisterComponentRoutes(r *mux.Route, componentClient storage.ComponentClient)

func RegisterJobRoutes

func RegisterJobRoutes(r *mux.Route, componentClient storage.ComponentClient, argoclient argoclient.Interface)

func RegisterOpenApiRoutes

func RegisterOpenApiRoutes(r *mux.Route)

func RegisterRoutes

func RegisterRoutes(r *mux.Route,
	componentClient storage.ComponentClient,
	volumeClient storage.VolumeClient,
	secretClient secret.SecretClient,
	argoclient argoclient.Interface,
	k8sclient kubernetes.Interface,
	sec auth.AuthenticationClient,
	authz auth.AuthorizationClient,
	wsclient workspace.WorkspaceClient,
	namespace string)

func RegisterSecretRoutes

func RegisterSecretRoutes(r *mux.Route, sclient secret.SecretClient, authz auth.AuthorizationClient)

func RegisterUserInfoRoutes

func RegisterUserInfoRoutes(r *mux.Route)

func RegisterVolumeRoutes

func RegisterVolumeRoutes(r *mux.Route, client storage.VolumeClient, authz auth.AuthorizationClient)

func RegisterWorkflowRoutes

func RegisterWorkflowRoutes(r *mux.Route, componentClient storage.ComponentClient)

func RegisterWorkspaceRoutes

func RegisterWorkspaceRoutes(r *mux.Route, k8sclient kubernetes.Interface, namespace string, wsClient workspace.WorkspaceClient)

func SecretDeleteHandler

func SecretDeleteHandler(client secret.SecretClient) http.HandlerFunc

func SecretListHandler

func SecretListHandler(client secret.SecretClient) http.HandlerFunc

func SecretPutHandler

func SecretPutHandler(client secret.SecretClient) http.HandlerFunc

func SecretsPathAuthorization

func SecretsPathAuthorization(action auth.Action, authz auth.AuthorizationClient, next http.HandlerFunc) http.HandlerFunc

func SetContentTypeMiddleware

func SetContentTypeMiddleware(mediatype string) func(http.Handler) http.Handler

func StartEventLoop

func StartEventLoop(ctx context.Context, watch watch.Interface, w io.Writer) error

func StoreComponent

func StoreComponent(ctx context.Context, client storage.ComponentClient, component models.Component) (models.ComponentReference, error)

func TerminateJob

func TerminateJob(ctx context.Context, argoClient argoclient.Interface, uid models.ComponentReference, workspace string) error

func TouchMetadata

func TouchMetadata(ctx context.Context, meta *models.Metadata)

func VolumeDeleteHandler

func VolumeDeleteHandler(vclient storage.VolumeClient) http.HandlerFunc

func VolumeGetHandler

func VolumeGetHandler(vclient storage.VolumeClient) http.HandlerFunc

func VolumePostHandler

func VolumePostHandler(vclient storage.VolumeClient) http.HandlerFunc

func VolumePutHandler

func VolumePutHandler(vclient storage.VolumeClient) http.HandlerFunc

func VolumesListHandler

func VolumesListHandler(vclient storage.VolumeClient) http.HandlerFunc

func VolumesPathAuthorization

func VolumesPathAuthorization(action auth.Action, authz auth.AuthorizationClient, next http.HandlerFunc) http.HandlerFunc

func WorkflowDeleteHandler

func WorkflowDeleteHandler(componentClient storage.ComponentClient) http.HandlerFunc

func WorkflowGetHandler

func WorkflowGetHandler(componentClient storage.ComponentClient) http.HandlerFunc

func WorkflowListHandler

func WorkflowListHandler(componentClient storage.ComponentClient) http.HandlerFunc

func WorkflowPatchHandler

func WorkflowPatchHandler(componentClient storage.ComponentClient) http.HandlerFunc

func WorkflowPostHandler

func WorkflowPostHandler(w http.ResponseWriter, r *http.Request, client storage.ComponentClient)

func WorkflowPutHandler

func WorkflowPutHandler(componentClient storage.ComponentClient) http.HandlerFunc

func WorkflowVersionListHandler

func WorkflowVersionListHandler(client storage.ComponentClient) http.HandlerFunc

func WorkspacesCreateHandler

func WorkspacesCreateHandler(k8sclient kubernetes.Interface, namespace string, wsClient workspace.WorkspaceClient) http.HandlerFunc

func WorkspacesDeleteHandler

func WorkspacesDeleteHandler(k8sclient kubernetes.Interface, namespace string, wsClient workspace.WorkspaceClient) http.HandlerFunc

func WorkspacesListHandler

func WorkspacesListHandler() http.HandlerFunc

func WorkspacesUpdateHandler

func WorkspacesUpdateHandler(k8sclient kubernetes.Interface, namespace string, wsClient workspace.WorkspaceClient) http.HandlerFunc

func WriteErrorResponse

func WriteErrorResponse(w http.ResponseWriter, apierr APIError, tag string)

unwrap the return code from the error and write a normal response

func WriteEventToSSEStream

func WriteEventToSSEStream(w io.Writer, f http.Flusher, evtObject interface{}) error

func WriteResponse

func WriteResponse(w http.ResponseWriter, status int, headers map[string]string, body any, tag string)

Types

type APIError

type APIError struct {
	Code    int    `json:"code"`
	Summary string `json:"summary"`
	Detail  string `json:"detail"`
}

type CRef

type ComponentPostOptions

type ComponentPostOptions struct {
}

type ComponentPostRequest

type ComponentPostRequest struct {
	Component models.Component     `json:"component"`
	Options   ComponentPostOptions `json:"options,omitempty"`
}

type SecretField

type SecretField struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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