dashboard

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthorized = errors.New("not authroized")
)

Functions

func ErrorResponse added in v0.4.0

func ErrorResponse(log *clog.Logger, err error) (dashv1alpha1.ImplResponse, error)

func NormalResponse added in v0.4.0

func NormalResponse(code int, body interface{}) (dashv1alpha1.ImplResponse, error)

Types

type HTTPRequestLogger

type HTTPRequestLogger struct {
	*clog.Logger
}

func NewHTTPRequestLogger

func NewHTTPRequestLogger(logr *clog.Logger) HTTPRequestLogger

func (HTTPRequestLogger) Middleware

func (l HTTPRequestLogger) Middleware(next http.Handler) http.Handler

type Server

type Server struct {
	Log                 *clog.Logger
	Klient              kosmo.Client
	GracefulShutdownDur time.Duration
	ResponseTimeout     time.Duration
	StaticFileDir       string
	Port                int
	MaxAgeSeconds       int
	SessionName         string
	TLSPrivateKeyPath   string
	TLSCertPath         string
	Insecure            bool

	Authorizers map[wsv1alpha1.UserAuthType]auth.Authorizer
	// contains filtered or unexported fields
}

Server serves dashboard APIs and UI static files It implements https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager#Runnable

func (*Server) DeleteNetworkRule

func (s *Server) DeleteNetworkRule(ctx context.Context, userId string, workspaceName string, networkRuleName string) (dashv1alpha1.ImplResponse, error)

func (*Server) DeleteUser

func (s *Server) DeleteUser(ctx context.Context, userId string) (dashv1alpha1.ImplResponse, error)

func (*Server) DeleteWorkspace

func (s *Server) DeleteWorkspace(ctx context.Context, userId string, workspaceName string) (dashv1alpha1.ImplResponse, error)

func (*Server) GetUser

func (s *Server) GetUser(ctx context.Context, userId string) (dashv1alpha1.ImplResponse, error)

func (*Server) GetUserAddonTemplates added in v0.2.0

func (s *Server) GetUserAddonTemplates(ctx context.Context) (dashv1alpha1.ImplResponse, error)

func (*Server) GetUsers

func (s *Server) GetUsers(ctx context.Context) (dashv1alpha1.ImplResponse, error)

func (*Server) GetWorkspace

func (s *Server) GetWorkspace(ctx context.Context, userId string, workspaceName string) (dashv1alpha1.ImplResponse, error)

func (*Server) GetWorkspaceTemplates

func (s *Server) GetWorkspaceTemplates(ctx context.Context) (dashv1alpha1.ImplResponse, error)

func (*Server) GetWorkspaces

func (s *Server) GetWorkspaces(ctx context.Context, userId string) (dashv1alpha1.ImplResponse, error)

func (*Server) Login

func (*Server) Logout

func (*Server) PatchWorkspace

func (s *Server) PatchWorkspace(ctx context.Context, userId, workspaceName string, req dashv1alpha1.PatchWorkspaceRequest) (dashv1alpha1.ImplResponse, error)

func (*Server) PostWorkspace

func (*Server) PutNetworkRule

func (s *Server) PutNetworkRule(ctx context.Context, userId string, workspaceName string, networkRuleName string, req dashv1alpha1.UpsertNetworkRuleRequest) (dashv1alpha1.ImplResponse, error)

func (*Server) PutUserName added in v0.3.0

func (*Server) PutUserPassword

func (*Server) PutUserRole

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start run server

func (*Server) Verify

type StoreStatusResponseWriter

type StoreStatusResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*StoreStatusResponseWriter) StatusCode

func (w *StoreStatusResponseWriter) StatusCode() int

func (*StoreStatusResponseWriter) StatusString

func (w *StoreStatusResponseWriter) StatusString() string

func (*StoreStatusResponseWriter) WriteHeader

func (w *StoreStatusResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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