common

package
v0.0.0-...-7212500 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Hanwuji   = "hanwuji"
	Suiyuan   = "suiyuan"
	Sailingsi = "sailingsi"
)

Variables

View Source
var (
	OctopusUrls = getOctopusUrls()
)

Functions

func GetRestyRequest

func GetRestyRequest() *resty.Request

func GetToken

func GetToken(kForToken string) string

func OctopusHttpClient

func OctopusHttpClient(method string, url string, payload io.Reader, token string) ([]byte, error)

Types

type HanwujiResp

type HanwujiResp struct {
	Success bool `json:"success"`
	Payload struct {
		MapResourceSpecIdList struct {
			Debug struct {
				ResourceSpecs []struct {
					Id               string `json:"id"`
					Name             string `json:"name"`
					Price            int    `json:"price"`
					ResourceQuantity struct {
						CambriconComMlu string `json:"cambricon.com/mlu,omitempty"`
						Cpu             string `json:"cpu"`
						Memory          string `json:"memory"`
						Shm             string `json:"shm,omitempty"`
					} `json:"resourceQuantity"`
				} `json:"resourceSpecs"`
			} `json:"debug"`
			Deploy struct {
				ResourceSpecs []interface{} `json:"resourceSpecs"`
			} `json:"deploy"`
			Train struct {
				ResourceSpecs []struct {
					Id               string `json:"id"`
					Name             string `json:"name"`
					Price            int    `json:"price"`
					ResourceQuantity struct {
						CambriconComMlu string `json:"cambricon.com/mlu,omitempty"`
						Cpu             string `json:"cpu"`
						Memory          string `json:"memory"`
						Shm             string `json:"shm,omitempty"`
					} `json:"resourceQuantity"`
				} `json:"resourceSpecs"`
			} `json:"train"`
		} `json:"mapResourceSpecIdList"`
	} `json:"payload"`
	Error interface{} `json:"error"`
}

type Login

type Login struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SailingsiResp

type SailingsiResp struct {
	Success bool `json:"success"`
	Payload struct {
		MapResourceSpecIdList struct {
			Debug struct {
				ResourceSpecs []interface{} `json:"resourceSpecs"`
			} `json:"debug"`
			Deploy struct {
				ResourceSpecs []interface{} `json:"resourceSpecs"`
			} `json:"deploy"`
			Train struct {
				ResourceSpecs []interface{} `json:"resourceSpecs"`
			} `json:"train"`
		} `json:"mapResourceSpecIdList"`
	} `json:"payload"`
	Error interface{} `json:"error"`
}

type SuiyuanResp

type SuiyuanResp struct {
	Success bool `json:"success"`
	Payload struct {
		MapResourceSpecIdList struct {
			Debug struct {
				ResourceSpecs []struct {
					Id               string `json:"id"`
					Name             string `json:"name"`
					Price            int    `json:"price"`
					ResourceQuantity struct {
						Cpu           string `json:"cpu,omitempty"`
						EnflameComDtu string `json:"enflame.com/dtu,omitempty"`
						Memory        string `json:"memory"`
						Shm           string `json:"shm,omitempty"`
						CpuCpu        string `json:"cpu_cpu,omitempty"`
					} `json:"resourceQuantity"`
				} `json:"resourceSpecs"`
			} `json:"debug"`
			Deploy struct {
				ResourceSpecs []interface{} `json:"resourceSpecs"`
			} `json:"deploy"`
			Train struct {
				ResourceSpecs []struct {
					Id               string `json:"id"`
					Name             string `json:"name"`
					Price            int    `json:"price"`
					ResourceQuantity struct {
						Cpu           string `json:"cpu"`
						EnflameComDtu string `json:"enflame.com/dtu"`
						Memory        string `json:"memory"`
						Shm           string `json:"shm"`
					} `json:"resourceQuantity"`
				} `json:"resourceSpecs"`
			} `json:"train"`
		} `json:"mapResourceSpecIdList"`
	} `json:"payload"`
	Error interface{} `json:"error"`
}

type TokenResp

type TokenResp struct {
	Success bool `json:"success"`
	Payload struct {
		Token      string `json:"token"`
		Expiration int    `json:"expiration"`
	} `json:"payload"`
	Error interface{} `json:"error"`
}

type TokenTimePair

type TokenTimePair struct {
	Token     string
	ExpiredAt time.Time
}

Jump to

Keyboard shortcuts

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