forms

package
v0.1.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserForm

type CreateUserForm struct {
	WriteUserForm
	Email    string `json:"email" form:"required,max=255,email"`
	Password string `json:"password" form:"required,max=255"`
}

CreateUserForm represents the accepted values for creating a user

func (*CreateUserForm) ToUser

ToUser converts a CreateUserForm to models.User

type DeleteUserForm

type DeleteUserForm struct {
	WriteUserForm
	ID       uint   `form:"required"`
	Password string `json:"password" form:"required,max=255"`
}

DeleteUserForm represents the accepted values for deleting a user

func (*DeleteUserForm) ToUser

ToUser converts a DeleteUserForm to models.User using the user ID

type GetReleaseForm

type GetReleaseForm struct {
	*ReleaseForm
	Name     string `json:"name" form:"required"`
	Revision int    `json:"revision"`
}

GetReleaseForm represents the accepted values for getting a single Helm release

type K8sForm

type K8sForm struct {
	*kubernetes.OutOfClusterConfig
}

K8sForm is the generic base type for CRUD operations on k8s objects

func (*K8sForm) PopulateK8sOptionsFromQueryParams

func (kf *K8sForm) PopulateK8sOptionsFromQueryParams(vals url.Values)

PopulateK8sOptionsFromQueryParams populates fields in the ReleaseForm using the passed url.Values (the parsed query params)

func (*K8sForm) PopulateK8sOptionsFromUserID

func (kf *K8sForm) PopulateK8sOptionsFromUserID(userID uint, repo repository.UserRepository) error

PopulateK8sOptionsFromUserID uses the passed userID to populate the HelmOptions object

type ListReleaseForm

type ListReleaseForm struct {
	*ReleaseForm
	*helm.ListFilter
}

ListReleaseForm represents the accepted values for listing Helm releases

func (*ListReleaseForm) PopulateListFromQueryParams

func (lrf *ListReleaseForm) PopulateListFromQueryParams(vals url.Values)

PopulateListFromQueryParams populates fields in the ListReleaseForm using the passed url.Values (the parsed query params)

type ListReleaseHistoryForm

type ListReleaseHistoryForm struct {
	*ReleaseForm
	Name string `json:"name" form:"required"`
}

ListReleaseHistoryForm represents the accepted values for getting a single Helm release

type LoginUserForm

type LoginUserForm struct {
	WriteUserForm
	ID       uint   `form:"required"`
	Email    string `json:"email" form:"required,max=255,email"`
	Password string `json:"password" form:"required,max=255"`
}

LoginUserForm represents the accepted values for logging a user in

func (*LoginUserForm) ToUser

ToUser converts a LoginUserForm to models.User

type ReleaseForm

type ReleaseForm struct {
	*helm.Form
}

ReleaseForm is the generic base type for CRUD operations on releases

func (*ReleaseForm) PopulateHelmOptionsFromQueryParams

func (rf *ReleaseForm) PopulateHelmOptionsFromQueryParams(vals url.Values)

PopulateHelmOptionsFromQueryParams populates fields in the ReleaseForm using the passed url.Values (the parsed query params)

func (*ReleaseForm) PopulateHelmOptionsFromUserID

func (rf *ReleaseForm) PopulateHelmOptionsFromUserID(userID uint, repo repository.UserRepository) error

PopulateHelmOptionsFromUserID uses the passed user ID to populate the HelmOptions object

type RollbackReleaseForm

type RollbackReleaseForm struct {
	*ReleaseForm
	Name     string `json:"name" form:"required"`
	Revision int    `json:"revision" form:"required"`
}

RollbackReleaseForm represents the accepted values for getting a single Helm release

type UpdateUserForm

type UpdateUserForm struct {
	WriteUserForm
	ID              uint     `form:"required"`
	RawKubeConfig   string   `json:"rawKubeConfig,omitempty"`
	AllowedContexts []string `json:"allowedContexts"`
}

UpdateUserForm represents the accepted values for updating a user

ID is a query parameter, the other two are sent in JSON body

func (*UpdateUserForm) ToUser

func (uuf *UpdateUserForm) ToUser(repo repository.UserRepository) (*models.User, error)

ToUser converts an UpdateUserForm to models.User by parsing the kubeconfig and the allowed clusters to generate a list of ClusterConfigs.

type UpgradeReleaseForm

type UpgradeReleaseForm struct {
	*ReleaseForm
	Name   string `json:"name" form:"required"`
	Values string `json:"values" form:"required"`
}

UpgradeReleaseForm represents the accepted values for updating a Helm release

type WriteUserForm

type WriteUserForm interface {
	ToUser(repo repository.UserRepository) (*models.User, error)
}

WriteUserForm is a generic form for write operations to the User model

Jump to

Keyboard shortcuts

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