client

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 17 Imported by: 4

README

Go Report Card GoDoc Build Status Twitter

client-go

Go client for ByteBuilders.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnAuthorized   = errors.New("401 Unauthorized")
	ErrForbidden      = errors.New("403 Forbidden")
	ErrNotFound       = errors.New("404 Not Found")
	ErrStatusConflict = errors.New("409 Conflict")
)

Functions

func Version

func Version() string

Version return the library version

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a ByteBuilders api client

func NewClient

func NewClient(baseURL ...string) *Client

NewClient initializes and returns a API client.

func NewClientWithHTTP

func NewClientWithHTTP(httpClient *http.Client, baseURL ...string) *Client

NewClientWithHTTP creates an API client with a custom http client

func (*Client) CheckClusterExistence

func (c *Client) CheckClusterExistence(opts clustermodel.CheckOptions) (*v1alpha1.ClusterInfo, error)

func (*Client) ConnectCluster

func (c *Client) ConnectCluster(opts clustermodel.ConnectOptions) (*v1alpha1.ClusterInfo, error)

func (*Client) GetCluster

func (c *Client) GetCluster(opts clustermodel.GetOptions) (*v1alpha1.ClusterInfo, error)

func (*Client) GetClusterClientConfig added in v0.0.2

func (c *Client) GetClusterClientConfig(opts clustermodel.GetOptions) (clientcmd.ClientConfig, error)

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (*api.User, error)

func (*Client) GetLicensePlan

func (c *Client) GetLicensePlan(licenseData, clusterID, productID string, productOwnerID int64) (string, error)

GetLicensePlan provides the plan corresponding to product id and owner id if it's still valid

func (*Client) GetProductByID

func (c *Client) GetProductByID(productID string) (*v1alpha1.Product, error)

GetProductByID provides the product associated with the product id

func (*Client) GetProductByOwnerAndKey

func (c *Client) GetProductByOwnerAndKey(owner, key string) (*v1alpha1.Product, error)

GetProductByOwnerAndKey provides the product associated with the owner name and product key

func (*Client) GetProductPlan

func (c *Client) GetProductPlan(productID, planID string) (*v1alpha1.Plan, error)

GetProductPlan provides the product plan associated with the product id and plan id

func (*Client) GetProductPlans

func (c *Client) GetProductPlans(productID string) (v1alpha1.PlanList, error)

GetProductPlans provides the product plan list associated with the product id

func (*Client) ImportCluster

func (c *Client) ImportCluster(opts clustermodel.ImportOptions, responseID string) (*v1alpha1.ClusterInfo, error)

func (*Client) ListClusters

func (c *Client) ListClusters(opts clustermodel.ListOptions) (*v1alpha1.ClusterInfoList, error)

func (*Client) NewNatsConnection

func (c *Client) NewNatsConnection(name string) (*nats.Conn, error)

func (*Client) ReconfigureCluster

func (c *Client) ReconfigureCluster(opts clustermodel.ReconfigureOptions, responseID string) (*v1alpha1.ClusterInfo, error)

func (*Client) RemoveCluster

func (c *Client) RemoveCluster(opts clustermodel.RemovalOptions, responseID string) error

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

SetHTTPClient replaces default http.Client with user given one.

func (*Client) Signin

func (c *Client) Signin(params SignInParams) ([]http.Cookie, error)

func (*Client) Signout

func (c *Client) Signout() error

func (*Client) VerifyLicense

func (c *Client) VerifyLicense(licenseData string) (*api.License, error)

VerifyLicense returns the verified license

func (*Client) WithAccessToken

func (c *Client) WithAccessToken(accessToken string) *Client

func (*Client) WithBasicAuth

func (c *Client) WithBasicAuth(username, password string) *Client

func (*Client) WithCookies

func (c *Client) WithCookies(cookies []http.Cookie) *Client

func (*Client) WithOrganization

func (c *Client) WithOrganization(org string) *Client

type SignInParams

type SignInParams struct {
	UserName string `json:"username"`
	Password string `json:"password"`
	Remember bool   `json:"remember"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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