resources

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAccountBasic = "client_secret_basic"
	ServiceAccountJWT   = "private_key_jwt"

	IAMRoleGuest        = IAMRole("guest")
	IAMRoleReporter     = IAMRole("reporter")
	IAMRoleDeveloper    = IAMRole("developer")
	IAMRoleMaintainer   = IAMRole("maintainer")
	IAMRoleProjectAdmin = IAMRole("project-admin")
	IAMRoleCompanyOwner = IAMRole("company-owner")
)

Variables

This section is empty.

Functions

func EncodeResourceToJSON

func EncodeResourceToJSON(obj interface{}) ([]byte, error)

func IAMEnvironmentRoleCompletion added in v0.12.0

func IAMEnvironmentRoleCompletion() func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

func IAMRoleCompletion added in v0.11.0

func IAMRoleCompletion(project bool) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

func IsValidEnvironmentRole added in v0.12.0

func IsValidEnvironmentRole(role IAMRole) bool

func IsValidIAMRole added in v0.11.0

func IsValidIAMRole(role IAMRole, project bool) bool

Types

type APIError

type APIError struct {
	StatusCode int    `json:"statusCode"`
	Message    string `json:"message"`
}

type AddMembersToGroup added in v0.11.0

type AddMembersToGroup struct {
	Members []string `json:"emails"` //nolint: tagliatelle
}

type AddUserRequest added in v0.11.0

type AddUserRequest struct {
	Email string  `json:"email"`
	Role  IAMRole `json:"role"`
}

type AuthProvider

type AuthProvider struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	Type  string `json:"type"`
}

type Cluster

type Cluster struct {
	ID           string `json:"_id"`       //nolint:tagliatelle
	DisplayName  string `json:"clusterId"` //nolint:tagliatelle
	Description  string `json:"description"`
	Distribution string `json:"distribution"`
	Vendor       string `json:"vendor"`
}

type Company

type Company struct {
	ID         string     `json:"_id"` //nolint:tagliatelle
	Name       string     `json:"name"`
	TenantID   string     `json:"tenantId"`
	Pipelines  Pipelines  `json:"pipelines"`
	Repository Repository `json:"repository"`
}

type CreateGroupRequest added in v0.11.0

type CreateGroupRequest struct {
	Name    string   `json:"name"`
	Role    IAMRole  `json:"role"`
	Members []string `json:"members"`
}

type CreateJob added in v0.8.0

type CreateJob struct {
	JobName string `json:"jobName"`
}

type CreateJobRequest added in v0.8.0

type CreateJobRequest struct {
	From         string `json:"from"`
	ResourceName string `json:"resourceName"`
}

type CronJob added in v0.8.0

type CronJob struct {
	Name         string    `json:"name"`
	Active       int       `json:"active"`
	Suspend      bool      `json:"suspend"`
	Schedule     string    `json:"schedule"`
	Age          time.Time `json:"creationTimestamp"` //nolint: tagliatelle
	LastSchedule time.Time `json:"lastScheduleTime"`  //nolint: tagliatelle
}

type DeployProject

type DeployProject struct {
	ID  int    `json:"id"`
	URL string `json:"url"`
}

type DeployProjectRequest

type DeployProjectRequest struct {
	Environment string `json:"environment"`
	Revision    string `json:"revision"`
	Type        string `json:"deployType"`              //nolint: tagliatelle
	ForceDeploy bool   `json:"forceDeployWhenNoSemver"` //nolint: tagliatelle
}

type Deployment added in v0.8.0

type Deployment struct {
	Name      string    `json:"name"`
	Available int       `json:"available"`
	Ready     int       `json:"ready"`
	Replicas  int       `json:"replicas"`
	Age       time.Time `json:"creationTimestamp"` //nolint: tagliatelle
}

type EditEnvironmentRole added in v0.12.0

type EditEnvironmentRole struct {
	EnvironmentID string  `json:"envId"` //nolint: tagliatelle
	Role          IAMRole `json:"role"`
}

type EditIAMRole added in v0.11.0

type EditIAMRole struct {
	Role         IAMRole           `json:"role,omitempty"`
	ProjectsRole []EditProjectRole `json:"projectsRole,omitempty"`
}

type EditProjectRole added in v0.12.0

type EditProjectRole struct {
	ProjectID        string                `json:"projectId"`
	Role             *IAMRole              `json:"role,omitempty"`
	EnvironmentsRole []EditEnvironmentRole `json:"environmentsRole,omitempty"`
}

type Environment

type Environment struct {
	DisplayName  string         `json:"label"` //nolint:tagliatelle
	EnvID        string         `json:"envId"`
	Cluster      ProjectCluster `json:"cluster"`
	IsProduction bool           `json:"isProduction"`
}

type EnvironmentRole added in v0.12.0

type EnvironmentRole struct {
	ID    string   `json:"envId"` //nolint: tagliatelle
	Roles []string `json:"roles"`
}

type GroupIdentity added in v0.10.0

type GroupIdentity struct {
	ID      string         `json:"_id"` //nolint: tagliatelle
	Name    string         `json:"name"`
	Role    string         `json:"role"`
	RoleID  string         `json:"roleId"`
	Members []UserIdentity `json:"members"`
}

type IAMIdentity added in v0.10.0

type IAMIdentity struct {
	ID           string        `json:"identityId"` //nolint: tagliatelle
	Name         string        `json:"name"`
	Type         string        `json:"identityType"` //nolint: tagliatelle
	Roles        []string      `json:"companyRoles"` //nolint: tagliatelle
	ProjectsRole []ProjectRole `json:"projects"`     //nolint: tagliatelle
}

type IAMRole added in v0.11.0

type IAMRole string

func (IAMRole) String added in v0.11.0

func (role IAMRole) String() string

type JWTServiceAccountJSON added in v0.7.0

type JWTServiceAccountJSON struct {
	Type           string `json:"type"`
	KeyID          string `json:"key-id"`           //nolint: tagliatelle
	PrivateKeyData string `json:"private-key-data"` //nolint: tagliatelle
	ClientID       string `json:"client-id"`        //nolint: tagliatelle
}

type JWTTokenRequest

type JWTTokenRequest struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

type Job added in v0.8.0

type Job struct {
	Name           string    `json:"name"`
	Active         int       `json:"active"`
	Failed         int       `json:"failed"`
	Succeeded      int       `json:"succeeded"`
	Age            time.Time `json:"creationTimestamp"` //nolint: tagliatelle
	StartTime      time.Time `json:"startTime"`
	CompletionTime time.Time `json:"completionTime"`
}

type MarketplaceItem added in v0.8.0

type MarketplaceItem struct {
	ID          string `json:"_id"` //nolint:tagliatelle
	ItemID      string `json:"itemId"`
	Name        string `json:"name"`
	Type        string `json:"type"`
	SupportedBy string `json:"supportedBy"`
	TenantID    string `json:"tenantId"`
}

type PipelineStatus

type PipelineStatus struct {
	ID     int    `json:"id"`
	Status string `json:"status"`
}

type Pipelines

type Pipelines struct {
	Type string `json:"type"`
}

type Pod added in v0.8.0

type Pod struct {
	Name      string    `json:"name"`
	Phase     string    `json:"phase"`
	Status    string    `json:"status"`
	Age       time.Time `json:"startTime"` //nolint:tagliatelle
	Component []struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"component"`
	Containers []struct {
		Name         string `json:"name"`
		Ready        bool   `json:"ready"`
		RestartCount int    `json:"restartCount"`
		Status       string `json:"status"`
	} `json:"containers"`
}

type Port added in v0.8.0

type Port struct {
	Name       string `json:"name"`
	Port       int    `json:"port"`
	Protocol   string `json:"protocol"`
	TargetPort string `json:"targetPort"`
}

type Project

type Project struct {
	ID                   string        `json:"_id"` //nolint:tagliatelle
	Name                 string        `json:"name"`
	ConfigurationGitPath string        `json:"configurationGitPath"`
	Environments         []Environment `json:"environments"`
	ProjectID            string        `json:"projectId"`
	Pipelines            Pipelines     `json:"pipelines"`
	CompanyID            string        `json:"tenantId"` //nolint:tagliatelle
}

type ProjectCluster added in v0.8.0

type ProjectCluster struct {
	ID        string `json:"clusterId"` //nolint:tagliatelle
	Namespace string `json:"namespace"`
}

type ProjectRole added in v0.12.0

type ProjectRole struct {
	ID           string            `json:"_id"` //nolint: tagliatelle
	Roles        []string          `json:"roles"`
	Environments []EnvironmentRole `json:"environments"`
}

type PublicKey added in v0.7.0

type PublicKey struct {
	Type      string `json:"kty"` //nolint: tagliatelle
	Use       string `json:"use"` //nolint: tagliatelle
	Algorithm string `json:"alg"` //nolint: tagliatelle
	KeyID     string `json:"kid"` //nolint: tagliatelle
	Modulus   string `json:"n"`   //nolint: tagliatelle
	Exponent  string `json:"e"`   //nolint: tagliatelle
}

type RefreshTokenRequest

type RefreshTokenRequest struct {
	RefreshToken string `json:"refreshToken"`
}

type RemoveMembersToGroup added in v0.11.0

type RemoveMembersToGroup struct {
	Members []string `json:"memberIds"` //nolint: tagliatelle
}

type Repository

type Repository struct {
	Type string `json:"type"`
}

type RuntimeEvent added in v0.8.0

type RuntimeEvent struct {
	Type      string    `json:"type"`
	Object    string    `json:"subObjectPath"` //nolint: tagliatelle
	Message   string    `json:"message"`
	Reason    string    `json:"reason"`
	FirstSeen time.Time `json:"firstSeen"`
	LastSeen  time.Time `json:"lastSeen"`
}

func (*RuntimeEvent) UnmarshalJSON added in v0.8.0

func (re *RuntimeEvent) UnmarshalJSON(data []byte) error

type Service added in v0.8.0

type Service struct {
	Name      string    `json:"name"`
	Type      string    `json:"type"`
	ClusterIP string    `json:"clusterIP"` //nolint: tagliatelle
	Ports     []Port    `json:"ports"`
	Age       time.Time `json:"creationTimestamp"` //nolint: tagliatelle
}

type ServiceAccount added in v0.7.0

type ServiceAccount struct {
	ClientID         string `json:"clientId"`
	ClientSecret     string `json:"clientSecret"`
	ClientIDIssuedAt int64  `json:"clientIdIssuedAt"`
	Company          string `json:"company"`
}

type ServiceAccountIdentity added in v0.10.0

type ServiceAccountIdentity struct {
	ID         string    `json:"clientId"` //nolint: tagliatelle
	Name       string    `json:"name"`
	AuthMethod string    `json:"authMethod"`
	Roles      []string  `json:"companyRoles"` //nolint: tagliatelle
	LastLogin  time.Time `json:"lastLogin"`
}

func (*ServiceAccountIdentity) UnmarshalJSON added in v0.10.0

func (sai *ServiceAccountIdentity) UnmarshalJSON(data []byte) error

type ServiceAccountRequest

type ServiceAccountRequest struct {
	Name      string     `json:"name"`
	Type      string     `json:"tokenEndpointAuthMethod"` //nolint: tagliatelle
	Role      IAMRole    `json:"role"`
	PublicKey *PublicKey `json:"publicKey,omitempty"`
}

type UserIdentity added in v0.10.0

type UserIdentity struct {
	ID        string          `json:"userId"` //nolint: tagliatelle
	Email     string          `json:"email"`
	FullName  string          `json:"fullname"` //nolint: tagliatelle
	Name      string          `json:"name"`
	Roles     []string        `json:"companyRoles"` //nolint: tagliatelle
	LastLogin time.Time       `json:"lastLogin"`
	Groups    []GroupIdentity `json:"groups"`
}

func (*UserIdentity) UnmarshalJSON added in v0.10.0

func (ui *UserIdentity) UnmarshalJSON(data []byte) error

type UserToken

type UserToken struct {
	AccessToken  string `json:"accessToken"`
	RefreshToken string `json:"refreshToken"`
	ExpiresAt    int64  `json:"expiresAt"`
}

func (*UserToken) JWTToken

func (ut *UserToken) JWTToken() *oauth2.Token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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