v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTypeAssertionError is thrown when type an interface does not match the asserted type
	ErrTypeAssertionError = errors.New("unable to assert type")
)

Functions

func AssertApiV1alpha1UserAddonsRequired added in v0.2.0

func AssertApiV1alpha1UserAddonsRequired(obj ApiV1alpha1UserAddons) error

AssertApiV1alpha1UserAddonsRequired checks if the required fields are not zero-ed

func AssertCreateUserRequestRequired

func AssertCreateUserRequestRequired(obj CreateUserRequest) error

AssertCreateUserRequestRequired checks if the required fields are not zero-ed

func AssertCreateUserResponseRequired

func AssertCreateUserResponseRequired(obj CreateUserResponse) error

AssertCreateUserResponseRequired checks if the required fields are not zero-ed

func AssertCreateWorkspaceRequestRequired

func AssertCreateWorkspaceRequestRequired(obj CreateWorkspaceRequest) error

AssertCreateWorkspaceRequestRequired checks if the required fields are not zero-ed

func AssertCreateWorkspaceResponseRequired

func AssertCreateWorkspaceResponseRequired(obj CreateWorkspaceResponse) error

AssertCreateWorkspaceResponseRequired checks if the required fields are not zero-ed

func AssertDeleteUserResponseRequired

func AssertDeleteUserResponseRequired(obj DeleteUserResponse) error

AssertDeleteUserResponseRequired checks if the required fields are not zero-ed

func AssertDeleteWorkspaceResponseRequired

func AssertDeleteWorkspaceResponseRequired(obj DeleteWorkspaceResponse) error

AssertDeleteWorkspaceResponseRequired checks if the required fields are not zero-ed

func AssertGetUserResponseRequired

func AssertGetUserResponseRequired(obj GetUserResponse) error

AssertGetUserResponseRequired checks if the required fields are not zero-ed

func AssertGetWorkspaceResponseRequired

func AssertGetWorkspaceResponseRequired(obj GetWorkspaceResponse) error

AssertGetWorkspaceResponseRequired checks if the required fields are not zero-ed

func AssertListTemplatesResponseRequired

func AssertListTemplatesResponseRequired(obj ListTemplatesResponse) error

AssertListTemplatesResponseRequired checks if the required fields are not zero-ed

func AssertListUsersResponseRequired

func AssertListUsersResponseRequired(obj ListUsersResponse) error

AssertListUsersResponseRequired checks if the required fields are not zero-ed

func AssertListWorkspaceResponseRequired

func AssertListWorkspaceResponseRequired(obj ListWorkspaceResponse) error

AssertListWorkspaceResponseRequired checks if the required fields are not zero-ed

func AssertLoginRequestRequired

func AssertLoginRequestRequired(obj LoginRequest) error

AssertLoginRequestRequired checks if the required fields are not zero-ed

func AssertLoginResponseRequired

func AssertLoginResponseRequired(obj LoginResponse) error

AssertLoginResponseRequired checks if the required fields are not zero-ed

func AssertNetworkRuleRequired

func AssertNetworkRuleRequired(obj NetworkRule) error

AssertNetworkRuleRequired checks if the required fields are not zero-ed

func AssertPatchWorkspaceRequestRequired

func AssertPatchWorkspaceRequestRequired(obj PatchWorkspaceRequest) error

AssertPatchWorkspaceRequestRequired checks if the required fields are not zero-ed

func AssertPatchWorkspaceResponseRequired

func AssertPatchWorkspaceResponseRequired(obj PatchWorkspaceResponse) error

AssertPatchWorkspaceResponseRequired checks if the required fields are not zero-ed

func AssertRecurseApiV1alpha1UserAddonsRequired added in v0.2.0

func AssertRecurseApiV1alpha1UserAddonsRequired(objSlice interface{}) error

AssertRecurseApiV1alpha1UserAddonsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ApiV1alpha1UserAddons (e.g. [][]ApiV1alpha1UserAddons), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseCreateUserRequestRequired

func AssertRecurseCreateUserRequestRequired(objSlice interface{}) error

AssertRecurseCreateUserRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of CreateUserRequest (e.g. [][]CreateUserRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseCreateUserResponseRequired

func AssertRecurseCreateUserResponseRequired(objSlice interface{}) error

AssertRecurseCreateUserResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of CreateUserResponse (e.g. [][]CreateUserResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseCreateWorkspaceRequestRequired

func AssertRecurseCreateWorkspaceRequestRequired(objSlice interface{}) error

AssertRecurseCreateWorkspaceRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of CreateWorkspaceRequest (e.g. [][]CreateWorkspaceRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseCreateWorkspaceResponseRequired

func AssertRecurseCreateWorkspaceResponseRequired(objSlice interface{}) error

AssertRecurseCreateWorkspaceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of CreateWorkspaceResponse (e.g. [][]CreateWorkspaceResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseDeleteUserResponseRequired

func AssertRecurseDeleteUserResponseRequired(objSlice interface{}) error

AssertRecurseDeleteUserResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DeleteUserResponse (e.g. [][]DeleteUserResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseDeleteWorkspaceResponseRequired

func AssertRecurseDeleteWorkspaceResponseRequired(objSlice interface{}) error

AssertRecurseDeleteWorkspaceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of DeleteWorkspaceResponse (e.g. [][]DeleteWorkspaceResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseGetUserResponseRequired

func AssertRecurseGetUserResponseRequired(objSlice interface{}) error

AssertRecurseGetUserResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of GetUserResponse (e.g. [][]GetUserResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseGetWorkspaceResponseRequired

func AssertRecurseGetWorkspaceResponseRequired(objSlice interface{}) error

AssertRecurseGetWorkspaceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of GetWorkspaceResponse (e.g. [][]GetWorkspaceResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseInterfaceRequired

func AssertRecurseInterfaceRequired(obj interface{}, callback func(interface{}) error) error

AssertInterfaceRequired recursively checks each struct in a slice against the callback. This method traverse nested slices in a preorder fashion.

func AssertRecurseListTemplatesResponseRequired

func AssertRecurseListTemplatesResponseRequired(objSlice interface{}) error

AssertRecurseListTemplatesResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ListTemplatesResponse (e.g. [][]ListTemplatesResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseListUsersResponseRequired

func AssertRecurseListUsersResponseRequired(objSlice interface{}) error

AssertRecurseListUsersResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ListUsersResponse (e.g. [][]ListUsersResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseListWorkspaceResponseRequired

func AssertRecurseListWorkspaceResponseRequired(objSlice interface{}) error

AssertRecurseListWorkspaceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of ListWorkspaceResponse (e.g. [][]ListWorkspaceResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseLoginRequestRequired

func AssertRecurseLoginRequestRequired(objSlice interface{}) error

AssertRecurseLoginRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LoginRequest (e.g. [][]LoginRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseLoginResponseRequired

func AssertRecurseLoginResponseRequired(objSlice interface{}) error

AssertRecurseLoginResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of LoginResponse (e.g. [][]LoginResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseNetworkRuleRequired

func AssertRecurseNetworkRuleRequired(objSlice interface{}) error

AssertRecurseNetworkRuleRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of NetworkRule (e.g. [][]NetworkRule), otherwise ErrTypeAssertionError is thrown.

func AssertRecursePatchWorkspaceRequestRequired

func AssertRecursePatchWorkspaceRequestRequired(objSlice interface{}) error

AssertRecursePatchWorkspaceRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of PatchWorkspaceRequest (e.g. [][]PatchWorkspaceRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecursePatchWorkspaceResponseRequired

func AssertRecursePatchWorkspaceResponseRequired(objSlice interface{}) error

AssertRecursePatchWorkspaceResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of PatchWorkspaceResponse (e.g. [][]PatchWorkspaceResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseRemoveNetworkRuleResponseRequired

func AssertRecurseRemoveNetworkRuleResponseRequired(objSlice interface{}) error

AssertRecurseRemoveNetworkRuleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of RemoveNetworkRuleResponse (e.g. [][]RemoveNetworkRuleResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseTemplateRequired

func AssertRecurseTemplateRequired(objSlice interface{}) error

AssertRecurseTemplateRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Template (e.g. [][]Template), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseTemplateRequiredVarsRequired added in v0.2.0

func AssertRecurseTemplateRequiredVarsRequired(objSlice interface{}) error

AssertRecurseTemplateRequiredVarsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of TemplateRequiredVars (e.g. [][]TemplateRequiredVars), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpdateUserPasswordRequestRequired

func AssertRecurseUpdateUserPasswordRequestRequired(objSlice interface{}) error

AssertRecurseUpdateUserPasswordRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpdateUserPasswordRequest (e.g. [][]UpdateUserPasswordRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpdateUserPasswordResponseRequired

func AssertRecurseUpdateUserPasswordResponseRequired(objSlice interface{}) error

AssertRecurseUpdateUserPasswordResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpdateUserPasswordResponse (e.g. [][]UpdateUserPasswordResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpdateUserRoleRequestRequired

func AssertRecurseUpdateUserRoleRequestRequired(objSlice interface{}) error

AssertRecurseUpdateUserRoleRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpdateUserRoleRequest (e.g. [][]UpdateUserRoleRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpdateUserRoleResponseRequired

func AssertRecurseUpdateUserRoleResponseRequired(objSlice interface{}) error

AssertRecurseUpdateUserRoleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpdateUserRoleResponse (e.g. [][]UpdateUserRoleResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpsertNetworkRuleRequestRequired

func AssertRecurseUpsertNetworkRuleRequestRequired(objSlice interface{}) error

AssertRecurseUpsertNetworkRuleRequestRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpsertNetworkRuleRequest (e.g. [][]UpsertNetworkRuleRequest), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUpsertNetworkRuleResponseRequired

func AssertRecurseUpsertNetworkRuleResponseRequired(objSlice interface{}) error

AssertRecurseUpsertNetworkRuleResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UpsertNetworkRuleResponse (e.g. [][]UpsertNetworkRuleResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUserAddonsRequired added in v0.2.0

func AssertRecurseUserAddonsRequired(objSlice interface{}) error

AssertRecurseUserAddonsRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of UserAddons (e.g. [][]UserAddons), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseUserRequired

func AssertRecurseUserRequired(objSlice interface{}) error

AssertRecurseUserRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of User (e.g. [][]User), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseValueRequired

func AssertRecurseValueRequired(value reflect.Value, callback func(interface{}) error) error

AssertNestedValueRequired checks each struct in the nested slice against the callback. This method traverse nested slices in a preorder fashion.

func AssertRecurseVerifyResponseRequired

func AssertRecurseVerifyResponseRequired(objSlice interface{}) error

AssertRecurseVerifyResponseRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of VerifyResponse (e.g. [][]VerifyResponse), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseWorkspaceRequired

func AssertRecurseWorkspaceRequired(objSlice interface{}) error

AssertRecurseWorkspaceRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of Workspace (e.g. [][]Workspace), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseWorkspaceSpecRequired

func AssertRecurseWorkspaceSpecRequired(objSlice interface{}) error

AssertRecurseWorkspaceSpecRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of WorkspaceSpec (e.g. [][]WorkspaceSpec), otherwise ErrTypeAssertionError is thrown.

func AssertRecurseWorkspaceStatusRequired

func AssertRecurseWorkspaceStatusRequired(objSlice interface{}) error

AssertRecurseWorkspaceStatusRequired recursively checks if required fields are not zero-ed in a nested slice. Accepts only nested slice of WorkspaceStatus (e.g. [][]WorkspaceStatus), otherwise ErrTypeAssertionError is thrown.

func AssertRemoveNetworkRuleResponseRequired

func AssertRemoveNetworkRuleResponseRequired(obj RemoveNetworkRuleResponse) error

AssertRemoveNetworkRuleResponseRequired checks if the required fields are not zero-ed

func AssertTemplateRequired

func AssertTemplateRequired(obj Template) error

AssertTemplateRequired checks if the required fields are not zero-ed

func AssertTemplateRequiredVarsRequired added in v0.2.0

func AssertTemplateRequiredVarsRequired(obj TemplateRequiredVars) error

AssertTemplateRequiredVarsRequired checks if the required fields are not zero-ed

func AssertUpdateUserPasswordRequestRequired

func AssertUpdateUserPasswordRequestRequired(obj UpdateUserPasswordRequest) error

AssertUpdateUserPasswordRequestRequired checks if the required fields are not zero-ed

func AssertUpdateUserPasswordResponseRequired

func AssertUpdateUserPasswordResponseRequired(obj UpdateUserPasswordResponse) error

AssertUpdateUserPasswordResponseRequired checks if the required fields are not zero-ed

func AssertUpdateUserRoleRequestRequired

func AssertUpdateUserRoleRequestRequired(obj UpdateUserRoleRequest) error

AssertUpdateUserRoleRequestRequired checks if the required fields are not zero-ed

func AssertUpdateUserRoleResponseRequired

func AssertUpdateUserRoleResponseRequired(obj UpdateUserRoleResponse) error

AssertUpdateUserRoleResponseRequired checks if the required fields are not zero-ed

func AssertUpsertNetworkRuleRequestRequired

func AssertUpsertNetworkRuleRequestRequired(obj UpsertNetworkRuleRequest) error

AssertUpsertNetworkRuleRequestRequired checks if the required fields are not zero-ed

func AssertUpsertNetworkRuleResponseRequired

func AssertUpsertNetworkRuleResponseRequired(obj UpsertNetworkRuleResponse) error

AssertUpsertNetworkRuleResponseRequired checks if the required fields are not zero-ed

func AssertUserAddonsRequired added in v0.2.0

func AssertUserAddonsRequired(obj UserAddons) error

AssertUserAddonsRequired checks if the required fields are not zero-ed

func AssertUserRequired

func AssertUserRequired(obj User) error

AssertUserRequired checks if the required fields are not zero-ed

func AssertVerifyResponseRequired

func AssertVerifyResponseRequired(obj VerifyResponse) error

AssertVerifyResponseRequired checks if the required fields are not zero-ed

func AssertWorkspaceRequired

func AssertWorkspaceRequired(obj Workspace) error

AssertWorkspaceRequired checks if the required fields are not zero-ed

func AssertWorkspaceSpecRequired

func AssertWorkspaceSpecRequired(obj WorkspaceSpec) error

AssertWorkspaceSpecRequired checks if the required fields are not zero-ed

func AssertWorkspaceStatusRequired

func AssertWorkspaceStatusRequired(obj WorkspaceStatus) error

AssertWorkspaceStatusRequired checks if the required fields are not zero-ed

func DefaultErrorHandler

func DefaultErrorHandler(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)

DefaultErrorHandler defines the default logic on how to handle errors from the controller. Any errors from parsing request params will return a StatusBadRequest. Otherwise, the error code originating from the servicer will be used.

func EncodeJSONResponse

func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error

EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code

func IsZeroValue

func IsZeroValue(val interface{}) bool

IsZeroValue checks if the val is the zero-ed value.

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter(routers ...Router) *mux.Router

NewRouter creates a new router for any number of api routers

func ReadFormFileToTempFile

func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)

ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file

func ReadFormFilesToTempFiles

func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)

ReadFormFilesToTempFiles reads files array data from a request form and writes it to a temporary files

Types

type ApiV1alpha1UserAddons added in v0.2.0

type ApiV1alpha1UserAddons struct {
	Template string `json:"template"`

	Vars map[string]string `json:"vars,omitempty"`
}

type AuthApiController

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

AuthApiController binds http requests to an api service and writes the service results to the http response

func (*AuthApiController) Login

Login - Login

func (*AuthApiController) Logout

Logout - Logout

func (*AuthApiController) Routes

func (c *AuthApiController) Routes() Routes

Routes returns all of the api route for the AuthApiController

func (*AuthApiController) Verify

Verify - Verify auth

type AuthApiOption

type AuthApiOption func(*AuthApiController)

AuthApiOption for how the controller is set up.

func WithAuthApiErrorHandler

func WithAuthApiErrorHandler(h ErrorHandler) AuthApiOption

WithAuthApiErrorHandler inject ErrorHandler into controller

type AuthApiRouter

type AuthApiRouter interface {
	Login(http.ResponseWriter, *http.Request)
	Logout(http.ResponseWriter, *http.Request)
	Verify(http.ResponseWriter, *http.Request)
}

AuthApiRouter defines the required methods for binding the api requests to a responses for the AuthApi The AuthApiRouter implementation should parse necessary information from the http request, pass the data to a AuthApiServicer to perform the required actions, then write the service results to the http response.

type AuthApiServicer

type AuthApiServicer interface {
	Login(context.Context, LoginRequest) (ImplResponse, error)
	Logout(context.Context) (ImplResponse, error)
	Verify(context.Context) (ImplResponse, error)
}

AuthApiServicer defines the api actions for the AuthApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type CreateUserRequest

type CreateUserRequest struct {
	Id string `json:"id"`

	DisplayName string `json:"displayName,omitempty"`

	Role string `json:"role,omitempty"`

	AuthType string `json:"authType,omitempty"`

	Addons []ApiV1alpha1UserAddons `json:"addons,omitempty"`
}

type CreateUserResponse

type CreateUserResponse struct {
	Message string `json:"message"`

	User *User `json:"user"`
}

type CreateWorkspaceRequest

type CreateWorkspaceRequest struct {
	Name string `json:"name"`

	Template string `json:"template"`

	Vars map[string]string `json:"vars,omitempty"`
}

type CreateWorkspaceResponse

type CreateWorkspaceResponse struct {
	Message string `json:"message"`

	Workspace *Workspace `json:"workspace"`
}

type DeleteUserResponse

type DeleteUserResponse struct {
	Message string `json:"message"`

	User *User `json:"user"`
}

type DeleteWorkspaceResponse

type DeleteWorkspaceResponse struct {
	Message string `json:"message"`

	Workspace *Workspace `json:"workspace"`
}

type ErrorHandler

type ErrorHandler func(w http.ResponseWriter, r *http.Request, err error, result *ImplResponse)

ErrorHandler defines the required method for handling error. You may implement it and inject this into a controller if you would like errors to be handled differently from the DefaultErrorHandler

type GetUserResponse

type GetUserResponse struct {
	User *User `json:"user"`
}

type GetWorkspaceResponse

type GetWorkspaceResponse struct {
	Workspace *Workspace `json:"workspace"`
}

type ImplResponse

type ImplResponse struct {
	Code int
	Body interface{}
}

Implementation response defines an error code with the associated body

func Response

func Response(code int, body interface{}) ImplResponse

Response return a ImplResponse struct filled

type ListTemplatesResponse

type ListTemplatesResponse struct {
	Message string `json:"message,omitempty"`

	Items []Template `json:"items"`
}

type ListUsersResponse

type ListUsersResponse struct {
	Message string `json:"message,omitempty"`

	Items []User `json:"items"`
}

type ListWorkspaceResponse

type ListWorkspaceResponse struct {
	Message string `json:"message,omitempty"`

	Items []Workspace `json:"items"`
}

type LoginRequest

type LoginRequest struct {
	Id string `json:"id"`

	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Id string `json:"id"`

	ExpireAt time.Time `json:"expireAt"`

	RequirePasswordUpdate bool `json:"requirePasswordUpdate,omitempty"`
}

type NetworkRule

type NetworkRule struct {
	PortName string `json:"portName"`

	PortNumber int32 `json:"portNumber"`

	Group string `json:"group,omitempty"`

	HttpPath string `json:"httpPath,omitempty"`

	Url string `json:"url,omitempty"`
}

type ParsingError

type ParsingError struct {
	Err error
}

ParsingError indicates that an error has occurred when parsing request parameters

func (*ParsingError) Error

func (e *ParsingError) Error() string

func (*ParsingError) Unwrap

func (e *ParsingError) Unwrap() error

type PatchWorkspaceRequest

type PatchWorkspaceRequest struct {
	Replicas *int64 `json:"replicas,omitempty"`
}

type PatchWorkspaceResponse

type PatchWorkspaceResponse struct {
	Message string `json:"message"`

	Workspace *Workspace `json:"workspace"`
}

type RemoveNetworkRuleResponse

type RemoveNetworkRuleResponse struct {
	Message string `json:"message"`

	NetworkRule NetworkRule `json:"networkRule"`
}

type RequiredError

type RequiredError struct {
	Field string
}

RequiredError indicates that an error has occurred when parsing request parameters

func (*RequiredError) Error

func (e *RequiredError) Error() string

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

A Route defines the parameters for an api endpoint

type Router

type Router interface {
	Routes() Routes
}

Router defines the required methods for retrieving api routes

func NewAuthApiController

func NewAuthApiController(s AuthApiServicer, opts ...AuthApiOption) Router

NewAuthApiController creates a default api controller

func NewTemplateApiController

func NewTemplateApiController(s TemplateApiServicer, opts ...TemplateApiOption) Router

NewTemplateApiController creates a default api controller

func NewUserApiController

func NewUserApiController(s UserApiServicer, opts ...UserApiOption) Router

NewUserApiController creates a default api controller

func NewWorkspaceApiController

func NewWorkspaceApiController(s WorkspaceApiServicer, opts ...WorkspaceApiOption) Router

NewWorkspaceApiController creates a default api controller

type Routes

type Routes []Route

Routes are a collection of defined api endpoints

type Template

type Template struct {
	Name string `json:"name"`

	Description string `json:"description,omitempty"`

	RequiredVars []TemplateRequiredVars `json:"requiredVars,omitempty"`

	IsDefaultUserAddon *bool `json:"isDefaultUserAddon,omitempty"`
}

type TemplateApiController

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

TemplateApiController binds http requests to an api service and writes the service results to the http response

func (*TemplateApiController) GetUserAddonTemplates added in v0.2.0

func (c *TemplateApiController) GetUserAddonTemplates(w http.ResponseWriter, r *http.Request)

GetUserAddonTemplates - List useraddon templates

func (*TemplateApiController) GetWorkspaceTemplates

func (c *TemplateApiController) GetWorkspaceTemplates(w http.ResponseWriter, r *http.Request)

GetWorkspaceTemplates - List workspace templates

func (*TemplateApiController) Routes

func (c *TemplateApiController) Routes() Routes

Routes returns all of the api route for the TemplateApiController

type TemplateApiOption

type TemplateApiOption func(*TemplateApiController)

TemplateApiOption for how the controller is set up.

func WithTemplateApiErrorHandler

func WithTemplateApiErrorHandler(h ErrorHandler) TemplateApiOption

WithTemplateApiErrorHandler inject ErrorHandler into controller

type TemplateApiRouter

type TemplateApiRouter interface {
	GetUserAddonTemplates(http.ResponseWriter, *http.Request)
	GetWorkspaceTemplates(http.ResponseWriter, *http.Request)
}

TemplateApiRouter defines the required methods for binding the api requests to a responses for the TemplateApi The TemplateApiRouter implementation should parse necessary information from the http request, pass the data to a TemplateApiServicer to perform the required actions, then write the service results to the http response.

type TemplateApiServicer

type TemplateApiServicer interface {
	GetUserAddonTemplates(context.Context) (ImplResponse, error)
	GetWorkspaceTemplates(context.Context) (ImplResponse, error)
}

TemplateApiServicer defines the api actions for the TemplateApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type TemplateRequiredVars added in v0.2.0

type TemplateRequiredVars struct {
	VarName string `json:"varName"`

	DefaultValue string `json:"defaultValue,omitempty"`
}

type UpdateUserPasswordRequest

type UpdateUserPasswordRequest struct {
	CurrentPassword string `json:"currentPassword"`

	NewPassword string `json:"newPassword"`
}

type UpdateUserPasswordResponse

type UpdateUserPasswordResponse struct {
	Message string `json:"message"`
}

type UpdateUserRoleRequest

type UpdateUserRoleRequest struct {
	Role string `json:"role"`
}

type UpdateUserRoleResponse

type UpdateUserRoleResponse struct {
	Message string `json:"message"`

	User *User `json:"user"`
}

type UpsertNetworkRuleRequest

type UpsertNetworkRuleRequest struct {
	PortNumber int32 `json:"portNumber"`

	Group string `json:"group,omitempty"`

	HttpPath string `json:"httpPath,omitempty"`
}

type UpsertNetworkRuleResponse

type UpsertNetworkRuleResponse struct {
	Message string `json:"message"`

	NetworkRule NetworkRule `json:"networkRule"`
}

type User

type User struct {
	Id string `json:"id"`

	DisplayName string `json:"displayName,omitempty"`

	Role string `json:"role,omitempty"`

	AuthType string `json:"authType,omitempty"`

	Addons []ApiV1alpha1UserAddons `json:"addons,omitempty"`

	DefaultPassword string `json:"defaultPassword,omitempty"`

	Status string `json:"status,omitempty"`
}

type UserAddons added in v0.2.0

type UserAddons struct {
	Template string `json:"template"`

	Vars map[string]string `json:"vars,omitempty"`
}

type UserApiController

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

UserApiController binds http requests to an api service and writes the service results to the http response

func (*UserApiController) DeleteUser

func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request)

DeleteUser - Delete user by ID.

func (*UserApiController) GetUser

func (c *UserApiController) GetUser(w http.ResponseWriter, r *http.Request)

GetUser - Get user by ID.

func (*UserApiController) GetUsers

func (c *UserApiController) GetUsers(w http.ResponseWriter, r *http.Request)

GetUsers - Get all users.

func (*UserApiController) PostUser

func (c *UserApiController) PostUser(w http.ResponseWriter, r *http.Request)

PostUser - Create a new User

func (*UserApiController) PutUserPassword

func (c *UserApiController) PutUserPassword(w http.ResponseWriter, r *http.Request)

PutUserPassword - Update user password

func (*UserApiController) PutUserRole

func (c *UserApiController) PutUserRole(w http.ResponseWriter, r *http.Request)

PutUserRole - Update user role

func (*UserApiController) Routes

func (c *UserApiController) Routes() Routes

Routes returns all of the api route for the UserApiController

type UserApiOption

type UserApiOption func(*UserApiController)

UserApiOption for how the controller is set up.

func WithUserApiErrorHandler

func WithUserApiErrorHandler(h ErrorHandler) UserApiOption

WithUserApiErrorHandler inject ErrorHandler into controller

type UserApiRouter

type UserApiRouter interface {
	DeleteUser(http.ResponseWriter, *http.Request)
	GetUser(http.ResponseWriter, *http.Request)
	GetUsers(http.ResponseWriter, *http.Request)
	PostUser(http.ResponseWriter, *http.Request)
	PutUserPassword(http.ResponseWriter, *http.Request)
	PutUserRole(http.ResponseWriter, *http.Request)
}

UserApiRouter defines the required methods for binding the api requests to a responses for the UserApi The UserApiRouter implementation should parse necessary information from the http request, pass the data to a UserApiServicer to perform the required actions, then write the service results to the http response.

type UserApiServicer

UserApiServicer defines the api actions for the UserApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type VerifyResponse

type VerifyResponse struct {
	Id string `json:"id"`

	ExpireAt time.Time `json:"expireAt"`

	RequirePasswordUpdate bool `json:"requirePasswordUpdate,omitempty"`
}

type Workspace

type Workspace struct {
	Name string `json:"name"`

	OwnerID string `json:"ownerID,omitempty"`

	Spec WorkspaceSpec `json:"spec,omitempty"`

	Status WorkspaceStatus `json:"status,omitempty"`
}

type WorkspaceApiController

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

WorkspaceApiController binds http requests to an api service and writes the service results to the http response

func (*WorkspaceApiController) DeleteNetworkRule

func (c *WorkspaceApiController) DeleteNetworkRule(w http.ResponseWriter, r *http.Request)

DeleteNetworkRule - Remove workspace network rule

func (*WorkspaceApiController) DeleteWorkspace

func (c *WorkspaceApiController) DeleteWorkspace(w http.ResponseWriter, r *http.Request)

DeleteWorkspace - Delete workspace.

func (*WorkspaceApiController) GetWorkspace

func (c *WorkspaceApiController) GetWorkspace(w http.ResponseWriter, r *http.Request)

GetWorkspace - Get workspace by name.

func (*WorkspaceApiController) GetWorkspaces

func (c *WorkspaceApiController) GetWorkspaces(w http.ResponseWriter, r *http.Request)

GetWorkspaces - Get all workspace of user.

func (*WorkspaceApiController) PatchWorkspace

func (c *WorkspaceApiController) PatchWorkspace(w http.ResponseWriter, r *http.Request)

PatchWorkspace - Update workspace.

func (*WorkspaceApiController) PostWorkspace

func (c *WorkspaceApiController) PostWorkspace(w http.ResponseWriter, r *http.Request)

PostWorkspace - Create a new Workspace

func (*WorkspaceApiController) PutNetworkRule

func (c *WorkspaceApiController) PutNetworkRule(w http.ResponseWriter, r *http.Request)

PutNetworkRule - Upsert workspace network rule

func (*WorkspaceApiController) Routes

func (c *WorkspaceApiController) Routes() Routes

Routes returns all of the api route for the WorkspaceApiController

type WorkspaceApiOption

type WorkspaceApiOption func(*WorkspaceApiController)

WorkspaceApiOption for how the controller is set up.

func WithWorkspaceApiErrorHandler

func WithWorkspaceApiErrorHandler(h ErrorHandler) WorkspaceApiOption

WithWorkspaceApiErrorHandler inject ErrorHandler into controller

type WorkspaceApiRouter

type WorkspaceApiRouter interface {
	DeleteNetworkRule(http.ResponseWriter, *http.Request)
	DeleteWorkspace(http.ResponseWriter, *http.Request)
	GetWorkspace(http.ResponseWriter, *http.Request)
	GetWorkspaces(http.ResponseWriter, *http.Request)
	PatchWorkspace(http.ResponseWriter, *http.Request)
	PostWorkspace(http.ResponseWriter, *http.Request)
	PutNetworkRule(http.ResponseWriter, *http.Request)
}

WorkspaceApiRouter defines the required methods for binding the api requests to a responses for the WorkspaceApi The WorkspaceApiRouter implementation should parse necessary information from the http request, pass the data to a WorkspaceApiServicer to perform the required actions, then write the service results to the http response.

type WorkspaceApiServicer

WorkspaceApiServicer defines the api actions for the WorkspaceApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.

type WorkspaceSpec

type WorkspaceSpec struct {
	Template string `json:"template"`

	Replicas int64 `json:"replicas"`

	Vars map[string]string `json:"vars,omitempty"`

	AdditionalNetwork []NetworkRule `json:"additionalNetwork,omitempty"`
}

type WorkspaceStatus

type WorkspaceStatus struct {
	Phase string `json:"phase"`

	MainUrl string `json:"mainUrl,omitempty"`

	UrlBase string `json:"urlBase,omitempty"`
}

Jump to

Keyboard shortcuts

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