kubepi

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKubePiUsername = "admin"
	DefaultKubePiPassword = "kubepi"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication struct {
	Mode              string      `json:"mode"`
	BearerToken       string      `json:"bearerToken"`
	Certificate       Certificate `json:"certificate" storm:"inline"`
	ConfigFileContent []byte      `json:"configFileContent"`
}

type Certificate

type Certificate struct {
	KeyData  []byte `json:"keyData"`
	CertData []byte `json:"certData"`
}

type ConnInfo

type ConnInfo struct {
	Name               string `json:"name"`
	ApiServer          string `json:"apiServer"`
	AuthenticationMode string `json:"authenticationMode"`
	KubernetesToken    string `json:"kubernetesToken"`
	CertDataStr        string `json:"certDataStr"`
	KeyDataStr         string `json:"keyDataStr"`
	ConfigContent      string `json:"configContent"`
}

type ImportConfig

type ImportConfig struct {
	Name      string `json:"name"`
	ApiServer string `json:"api_server"`
	Token     string `json:"token"`
}

type ImportResponse

type ImportResponse struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
}

type Interface

type Interface interface {
	CheckLogin() error
	Open(conn ConnInfo) (Opener, error)
	Close(name, apiServer string) error
	SearchUsers() (*ListUser, error)
	SetOptions(...Option)
}

func GetClient

func GetClient(ops ...Option) Interface

type IsLoginResponse

type IsLoginResponse struct {
	Success bool `json:"success"`
	Data    bool `json:"data"`
}

type KubePi

type KubePi struct {
	Username string
	Password string
	Host     string
	Port     int
	// contains filtered or unexported fields
}

func NewKubePi

func NewKubePi() *KubePi

func (*KubePi) CheckLogin

func (k *KubePi) CheckLogin() error

func (*KubePi) Close

func (k *KubePi) Close(name, apiServer string) error

func (*KubePi) Open

func (k *KubePi) Open(conn ConnInfo) (Opener, error)

func (*KubePi) SearchUsers

func (k *KubePi) SearchUsers() (*ListUser, error)

func (*KubePi) SetOptions

func (k *KubePi) SetOptions(ops ...Option)

type ListClustersResponse

type ListClustersResponse struct {
	Data    []kubePiCluster `json:"data"`
	Success bool            `json:"success"`
	Message string          `json:"message"`
}

type ListUser

type ListUser struct {
	Data    []interface{} `json:"data"`
	Success bool          `json:"success"`
	Message string        `json:"message"`
}

type LoginResponse

type LoginResponse struct {
	//Data    string `json:"data"`
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type Opener

type Opener struct {
	SessionCookie *http.Cookie
	Redirect      string
}

type Option

type Option func(pi *KubePi)

func WithUsernameAndPassword

func WithUsernameAndPassword(username string, password string) Option

Jump to

Keyboard shortcuts

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