request

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	LOGIN            = "/v1/login"
	CREATAPPLICATION = "/v1/application"
	CREATCLUSTER     = "/v1/cluster"
	CREATUSER        = "/v1/users"
	CREATEDEVSPACE   = "/v1/dev_space"
	UPDATEDEVSPACE   = "/v1/dev_space/%d"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiRequest

type ApiRequest struct {
	Req                     *req.Req
	BaseUrl                 string
	AuthToken               string
	ApplicationId           int
	ClusterId               int
	UserId                  int
	KubeConfig              string
	KubeConfigRaw           string
	Kubectl                 string
	NameSpace               string
	InternalKubeConfigRaw   string
	DevSpaceId              int
	NocalhostWebPort        int
	InjectBatchUserTemplate string
	InjectBatchUserIds      []int
	PortForwardPortLocally  int
	EnablePortForward       bool
	// contains filtered or unexported fields
}

func NewReq

func NewReq(baseUrl, kubeConfig, kubectl, namespace string, nocalhostWebPort int) *ApiRequest

func (*ApiRequest) AddBookInfoApplication

func (q *ApiRequest) AddBookInfoApplication(context string) *ApiRequest

func (*ApiRequest) AddBookInfoApplicationForThree

func (q *ApiRequest) AddBookInfoApplicationForThree() *ApiRequest

func (*ApiRequest) AddCluster

func (q *ApiRequest) AddCluster() *ApiRequest

func (*ApiRequest) AddDevSpace

func (q *ApiRequest) AddDevSpace() *ApiRequest

func (*ApiRequest) AddUser

func (q *ApiRequest) AddUser(email, password, name string) *ApiRequest

func (*ApiRequest) CheckPortIsAvailable

func (q *ApiRequest) CheckPortIsAvailable(port int) bool

func (*ApiRequest) ExposeService

func (q *ApiRequest) ExposeService() *ApiRequest

need to expose `kubectl port-forward service/nocalhost-web 65124:inits.port -n nocalhost` then login with endpoint

func (*ApiRequest) GetAvailableRandomLocalPort

func (q *ApiRequest) GetAvailableRandomLocalPort() *ApiRequest

func (*ApiRequest) GetKubeConfig

func (q *ApiRequest) GetKubeConfig() *ApiRequest

use "kubectl config view --minify --raw --flatten --kubeconfig " get current-context

func (*ApiRequest) IdleThePortForwardIfNeeded

func (q *ApiRequest) IdleThePortForwardIfNeeded() error

func (*ApiRequest) InjectBatchDevSpace

func (q *ApiRequest) InjectBatchDevSpace(amount, offset int) *ApiRequest

func (*ApiRequest) Login

func (q *ApiRequest) Login(email, password string) *ApiRequest

func (*ApiRequest) SetInjectBatchUserTemplate

func (q *ApiRequest) SetInjectBatchUserTemplate(userTemplate string) *ApiRequest

func (*ApiRequest) SpecifyService

func (q *ApiRequest) SpecifyService(addr string) *ApiRequest

func (*ApiRequest) UpdateDataBaseClusterUser

func (q *ApiRequest) UpdateDataBaseClusterUser() *ApiRequest

type LoginRes

type LoginRes struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    Token  `json:"data"`
}

type MiniKube

type MiniKube struct {
	MiniKubeDetail MiniKubeInfo `yaml:"minikube"`
}

type MiniKubeCluster

type MiniKubeCluster struct {
	ApiEndPoint MiniKube `yaml:"apiEndpoints"`
}

type MiniKubeInfo

type MiniKubeInfo struct {
	AdvertiseAddress string `yaml:"advertiseAddress"`
	BindPort         int    `yaml:"bindPort"`
}

type Response

type Response struct {
	Code    int                    `json:"code"`
	Message string                 `json:"message"`
	Data    map[string]interface{} `json:"data"`
}

type Token

type Token struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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