types

package
v0.18.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RamPolicyKeyStatement  = "Statement"
	RamPolicyKeyVersion    = "Version"
	RamPolicyVersionLatest = "1"
)

Variables

View Source
var (
	RamPolicyTypeSystem = "System"
	RamPolicyTypeCustom = "Custom"
)

Functions

This section is empty.

Types

type Account added in v0.17.0

type Account struct {
	Type    AccountType
	RootUId string
	User    RamUser
	Role    RamRole
}

func NewFakeAccount added in v0.17.0

func NewFakeAccount(uid int64) Account

func NewRootAccount added in v0.17.0

func NewRootAccount(uid int64) Account

func (Account) Deleted added in v0.17.0

func (a Account) Deleted() bool

func (Account) Id added in v0.17.0

func (a Account) Id() string

func (*Account) MarkDeleted added in v0.17.0

func (a *Account) MarkDeleted()

func (Account) Name added in v0.17.0

func (a Account) Name() string

type AccountType added in v0.17.0

type AccountType string
const (
	AccountTypeRoot AccountType = "Root"
	AccountTypeUser AccountType = "RamUser"
	AccountTypeRole AccountType = "RamRole"
)

type Cluster

type Cluster struct {
	ClusterId   string
	ClusterType ClusterType
	MetaData    ClusterMetaData
	Name        string
	RegionId    string
	State       ClusterState
}

type ClusterAddon added in v0.9.1

type ClusterAddon struct {
	Name        string `json:"component_name"`
	Version     string `json:"version"`
	NextVersion string `json:"next_version"`
}

func (ClusterAddon) Installed added in v0.9.1

func (c ClusterAddon) Installed() bool

type ClusterCredential added in v0.7.0

type ClusterCredential struct {
	// server
	Server string
	// certificate-authority-data
	CertificateAuthorityData string
	// client-certificate-data
	ClientCertificateData string
	// client-key-data
	ClientKeyData string
	// expiration
	Expiration time.Time
}

func (*ClusterCredential) LoadKubeConfig added in v0.7.0

func (c *ClusterCredential) LoadKubeConfig(conf *KubeConfig) error

type ClusterLog

type ClusterLog struct {
	Log     string
	Created time.Time
}

type ClusterMetaData

type ClusterMetaData struct {
	RRSAConfig RRSAConfig `json:"RRSAConfig"`
}

type ClusterState

type ClusterState string
var (
	ClusterStateRunning       ClusterState = "running"
	ClusterStateDeleting      ClusterState = "deleting"
	ClusterStateDeleted       ClusterState = "deleted"
	ClusterStateDeleteFailed  ClusterState = "delete_failed"
	ClusterStateFailed        ClusterState = "failed"
	ClusterStateWaiting       ClusterState = "waiting"
	ClusterStateDisconnected  ClusterState = "disconnected"
	ClusterStateInitial       ClusterState = "initial"
	ClusterStateCreateTimeout ClusterState = "create_timeout"
	ClusterStateUnavailable   ClusterState = "unavailable"
)

func (ClusterState) IsRunning

func (s ClusterState) IsRunning() bool

func (ClusterState) NoActiveApiServer added in v0.17.0

func (s ClusterState) NoActiveApiServer() bool

type ClusterTask

type ClusterTask struct {
	TaskId string
	State  ClusterTaskState
	Error  interface{}
	Result interface{}
}

func (ClusterTask) Err

func (t ClusterTask) Err() string

type ClusterTaskState

type ClusterTaskState string
var (
	ClusterTaskStateSuccess  ClusterTaskState = "success"
	ClusterTaskStateFail     ClusterTaskState = "fail"
	ClusterTaskStateTimeout  ClusterTaskState = "timeout"
	ClusterTaskStateCanceled ClusterTaskState = "canceled"
)

func (ClusterTaskState) IsNotSuccess

func (s ClusterTaskState) IsNotSuccess() bool

type ClusterType

type ClusterType string
var ClusterTypeManagedKubernetes ClusterType = "ManagedKubernetes"

type ExecCluster added in v0.7.0

type ExecCluster struct {
	Server                   string      `json:"server" yaml:"server"`
	TLSServerName            string      `json:"tls-server-name,omitempty" yaml:"tls-server-name,omitempty"`
	InsecureSkipTLSVerify    bool        `json:"insecure-skip-tls-verify,omitempty" yaml:"insecure-skip-tls-verify,omitempty"`
	CertificateAuthorityData string      `json:"certificate-authority-data,omitempty" yaml:"certificate-authority-data,omitempty"`
	ProxyURL                 string      `json:"proxy-url,omitempty" yaml:"proxy-url,omitempty"`
	DisableCompression       bool        `json:"disable-compression,omitempty" yaml:"disable-compression,omitempty"`
	Config                   interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}

type ExecCredential added in v0.7.0

type ExecCredential struct {
	KubeTypeMeta `json:",inline" yaml:",inline"`
	Spec         ExecCredentialSpec    `json:"spec,omitempty" yaml:"spec,omitempty"`
	Status       *ExecCredentialStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

type ExecCredentialSpec added in v0.7.0

type ExecCredentialSpec struct {
	Cluster     *ExecCluster `json:"cluster,omitempty" yaml:"cluster,omitempty"`
	Interactive bool         `json:"interactive" yaml:"interactive"`
}

type ExecCredentialStatus added in v0.7.0

type ExecCredentialStatus struct {
	ExpirationTimestamp   *KubeTime `json:"expirationTimestamp,omitempty" yaml:"expirationTimestamp,omitempty"`
	Token                 string    `json:"token,omitempty" yaml:"token,omitempty"`
	ClientCertificateData string    `json:"clientCertificateData,omitempty" yaml:"clientCertificateData,omitempty"`
	ClientKeyData         string    `json:"clientKeyData,omitempty" yaml:"clientKeyData,omitempty"`
}

type ExecInteractiveMode added in v0.7.0

type ExecInteractiveMode string
const (
	NeverExecInteractiveMode ExecInteractiveMode = "Never"
)

type KubeAuthInfo added in v0.7.0

type KubeAuthInfo struct {
	ClientCertificateData string          `json:"client-certificate-data,omitempty" yaml:"client-certificate-data,omitempty"`
	ClientKeyData         string          `json:"client-key-data,omitempty" yaml:"client-key-data,omitempty"`
	Exec                  *KubeExecConfig `json:"exec,omitempty" yaml:"exec,omitempty"`
}

type KubeAuthUser added in v0.7.0

type KubeAuthUser struct {
	Name string       `json:"name" yaml:"name"`
	User KubeAuthInfo `json:"user" yaml:"user"`
}

type KubeCluster added in v0.7.0

type KubeCluster struct {
	Name    string          `json:"name" yaml:"name"`
	Cluster KubeClusterInfo `json:"cluster" yaml:"cluster"`
}

type KubeClusterInfo added in v0.7.0

type KubeClusterInfo struct {
	Server string `json:"server" yaml:"server"`
	//TLSServerName            string `json:"tls-server-name,omitempty" yaml:"tls-server-name,omitempty"`
	//InsecureSkipTLSVerify    bool   `json:"insecure-skip-tls-verify,omitempty" yaml:"insecure-skip-tls-verify,omitempty"`
	//CertificateAuthority     string `json:"certificate-authority,omitempty" yaml:"certificate-authority,omitempty"`
	CertificateAuthorityData string `json:"certificate-authority-data,omitempty" yaml:"certificate-authority-data,omitempty"`
}

type KubeConfig added in v0.7.0

type KubeConfig struct {
	Kind           string         `json:"kind,omitempty" yaml:"kind,omitempty"`
	APIVersion     string         `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
	Clusters       []KubeCluster  `json:"clusters" yaml:"clusters"`
	Contexts       []KubeContext  `json:"contexts" yaml:"contexts"`
	CurrentContext string         `json:"current-context" yaml:"current-context"`
	Users          []KubeAuthUser `json:"users" yaml:"users"`
	Preferences    interface{}    `json:"preferences" yaml:"preferences"`

	Expiration time.Time `json:"-" yaml:"-"`
	RawData    string    `json:"-" yaml:"-"`
}

type KubeContext added in v0.7.0

type KubeContext struct {
	Name    string          `json:"name" yaml:"name"`
	Context KubeContextInfo `json:"context" yaml:"context"`
}

type KubeContextInfo added in v0.7.0

type KubeContextInfo struct {
	Cluster string `json:"cluster" yaml:"cluster"`
	User    string `json:"user" yaml:"user"`
}

type KubeExecConfig added in v0.7.0

type KubeExecConfig struct {
	Command string   `json:"command" yaml:"command"`
	Args    []string `json:"args" yaml:"args"`

	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`

	InstallHint string `json:"installHint,omitempty" yaml:"installHint,omitempty"`

	ProvideClusterInfo bool `json:"provideClusterInfo" yaml:"provideClusterInfo"`

	InteractiveMode ExecInteractiveMode `json:"interactiveMode" yaml:"interactiveMode"`
}

type KubeTime added in v0.7.0

type KubeTime struct {
	time.Time
}

func NewKubeTime added in v0.16.0

func NewKubeTime(t time.Time) KubeTime

func (KubeTime) MarshalJSON added in v0.7.0

func (t KubeTime) MarshalJSON() ([]byte, error)

func (KubeTime) MarshalYAML added in v0.7.0

func (t KubeTime) MarshalYAML() (interface{}, error)

type KubeTypeMeta added in v0.7.0

type KubeTypeMeta struct {
	Kind       string `json:"kind,omitempty" yaml:"kind,omitempty"`
	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
}

type RRSAConfig

type RRSAConfig struct {
	Enabled bool `json:"enabled"`

	Issuer   string `json:"issuer"`
	Audience string `json:"audience"`

	OIDCName string `json:"oidc_name"`
	OIDCArn  string `json:"oidc_arn"`
}

func (RRSAConfig) TokenIssuer added in v0.2.0

func (c RRSAConfig) TokenIssuer() string

type RamPolicy added in v0.6.0

type RamPolicy struct {
	DefaultVersion string
	//UpdateDate      string
	Description     string
	PolicyDocument  *RamPolicyDocument
	AttachmentCount int32
	PolicyName      string
	//CreateDate      string
	PolicyType string
}

type RamPolicyDocument added in v0.6.0

type RamPolicyDocument map[string]interface{}

func MakeRamPolicyDocument added in v0.6.0

func MakeRamPolicyDocument(policies []RamPolicyStatement) RamPolicyDocument

func (*RamPolicyDocument) AppendPolicy added in v0.6.0

func (p *RamPolicyDocument) AppendPolicy(policy RamPolicyStatement) error

func (*RamPolicyDocument) AppendPolicyIfNotExist added in v0.6.0

func (p *RamPolicyDocument) AppendPolicyIfNotExist(policy RamPolicyStatement) error

func (*RamPolicyDocument) IncludePolicy added in v0.6.0

func (p *RamPolicyDocument) IncludePolicy(policy RamPolicyStatement) (bool, error)

func (*RamPolicyDocument) JSON added in v0.6.0

func (p *RamPolicyDocument) JSON() string

type RamPolicyStatement added in v0.6.0

type RamPolicyStatement map[string]interface{}

func MakeAssumeRolePolicyStatementWithServiceAccount

func MakeAssumeRolePolicyStatementWithServiceAccount(oidcIssuer, oidcArn, namespace, serviceAccount string) RamPolicyStatement

func (*RamPolicyStatement) Equal added in v0.6.0

func (s *RamPolicyStatement) Equal(another RamPolicyStatement) bool

func (*RamPolicyStatement) JSON added in v0.6.0

func (s *RamPolicyStatement) JSON() string

type RamRole

type RamRole struct {
	RoleName                 string
	RoleId                   string
	Arn                      string
	Description              string
	AssumeRolePolicyDocument *RamPolicyDocument
	MaxSessionDuration       int64
	Deleted                  bool
}

type RamRolePolicy added in v0.6.0

type RamRolePolicy struct {
	DefaultVersion string
	Description    string
	PolicyName     string
	//AttachDate     string
	PolicyType string
}

type RamUser added in v0.17.0

type RamUser struct {
	Id          string
	Name        string
	DisplayName string
	Deleted     bool
}

Jump to

Keyboard shortcuts

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