opsgy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientID = "5fa304bcb1e86a777578db37"
View Source
var ClientSecret = "ec5d83fe4253dc26da36aafe1dd84b3e1c246d4d47074e6f4d32bff64b66dbee"
View Source
var ConfigFile = ""
View Source
var OpsgyAccountUrl = "https://account.opsgy.com"
View Source
var OpsgyApiUrl = "https://api.opsgy.com"

Functions

func GetClient

func GetClient(config *Config) (*http.Client, error)

func GetDefaultConfigFile

func GetDefaultConfigFile() string

func Logout

func Logout() error

func SaveConfig

func SaveConfig(config *Config) error

func SetConfigFile

func SetConfigFile(configFile string)

Types

type Cluster

type Cluster struct {
	ClusterID string         `json:"clusterId,omitempty"`
	ProjectID string         `json:"projectId,omitempty"`
	Name      string         `json:"name,omitempty"`
	Region    string         `json:"region,omitempty"`
	Status    *ClusterStatus `json:"status,omitempty"`
}

func GetClusterByName

func GetClusterByName(client *http.Client, projectID string, clusterName string) (*Cluster, error)

func GetClusters

func GetClusters(client *http.Client, projectID string) ([]*Cluster, error)

type ClusterPage

type ClusterPage struct {
	NextPage string     `json:"nextPage,omitempty"`
	PageSize int        `json:"pageSize,omitempty"`
	Items    []*Cluster `json:"items,omitempty"`
}

type ClusterStatus

type ClusterStatus struct {
	KubeApiURL string `json:"kubeApiUrl,omitempty"`
}

type Config

type Config struct {
	AccessToken  string    `yaml:"accessToken,omitempty"`
	RefreshToken string    `yaml:"refreshToken,omitempty"`
	TokenExpiry  time.Time `yaml:"tokenExpiry,omitempty"`
	TokenType    string    `yaml:"tokenType,omitempty"`

	ProjectName string `yaml:"projectName,omitempty"`
}

func LoadConfig

func LoadConfig() *Config

type Credentials

type Credentials struct {
	AccessToken  string    `yaml:"accessToken,omitempty"`
	RefreshToken string    `yaml:"refreshToken,omitempty"`
	TokenExpiry  time.Time `yaml:"tokenExpiry,omitempty"`
	TokenType    string    `yaml:"tokenType,omitempty"`
}

func Login

func Login(port int, scopes []string) (*Credentials, error)

type Project

type Project struct {
	ProjectID   string `json:"projectId,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsDefault   bool   `json:"isDefault,omitempty"`
}

func GetProjectByName

func GetProjectByName(client *http.Client, projectName string) (*Project, error)

func GetProjects

func GetProjects(client *http.Client) ([]*Project, error)

type ProjectPage

type ProjectPage struct {
	NextPage string     `json:"nextPage,omitempty"`
	PageSize int        `json:"pageSize,omitempty"`
	Items    []*Project `json:"items,omitempty"`
}

Jump to

Keyboard shortcuts

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