client

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 14 Imported by: 0

README

client-go GoDoc CI Go Report Card

Golang Client for Universe.sh API.

Example

package main

import (
	"context"
	"fmt"
	"log"
	"net/http"

	"golang.org/x/oauth2"

	"github.com/universe-sh/client-go"
)

// TokenSource OAuth2
type TokenSource struct {
	AccessToken string
}

// Token OAuth2
func (t *TokenSource) Token() (*oauth2.Token, error) {
	token := &oauth2.Token{
		AccessToken: t.AccessToken,
	}
	return token, nil
}

func main() {
	var (
		ctx         context.Context = context.Background()
		oauthClient *http.Client    = oauth2.NewClient(ctx, &TokenSource{AccessToken: "YOUR_TOKEN"})
		c                           = new(client.Client)
		project                     = new(client.Project)
		err         error
	)

    // Create NewClient API 
    c = client.NewClient(oauthClient)
    
    // Get project properties
	if project, _, err = c.Projects.Get(ctx, "my-project"); err != nil {
		log.Fatalf("Get project: %v", err)
	}

	fmt.Println(project)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

func DoRequest

func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error)

DoRequest submits an HTTP request.

func DoRequestWithClient

func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)

DoRequestWithClient submits an HTTP request using the specified client.

Types

type AccessConfig

type AccessConfig struct {
	Name string                     `json:"name,omitempty"`
	Type SatelliteGoogleNetworkType `json:"type,omitempty"`
	Tier SatelliteGoogleNetworkTier `json:"tier,omitempty"`
}

AccessConfig IP

type AliasIPRange

type AliasIPRange struct {
	IPCidrRange         string `json:"ip_cidr_range,omitempty"`
	SubnetworkRangeName string `json:"subnetwork_range_name,omitempty"`
}

AliasIPRange range IP

type ArgError

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

ArgError is an error that represents an error with an input to godo. It identifies the argument and the cause (if possible).

func NewArgError

func NewArgError(arg, reason string) *ArgError

NewArgError creates an InputError.

func (*ArgError) Error

func (e *ArgError) Error() string

type Autoscaling

type Autoscaling struct {
	Engine              []string `json:"engine,omitempty"`
	PreemptiblePourcent int64    `json:"preemptible_pourcent,omitempty"`
	MaxCPU              int64    `json:"max_cpu,omitempty"`
	MaxMemory           int64    `json:"max_memory,omitempty"`
}

Autoscaling represents the Satellite's Autoscaling.

type Client

type Client struct {

	// Base URL for API requests.
	BaseURL *url.URL

	// User agent for client
	UserAgent string

	// Rate contains the current rate limit for the client as determined by the most recent
	// API call.
	Rate Rate

	// Services used for communicating with the API
	Node                NodeService
	Region              RegionService
	SatelliteAmazon     SatelliteAmazonService
	SatelliteGoogle     SatelliteGoogleService
	SatelliteGooglePool SatelliteGooglePoolService
	Group               GroupService
	GroupAssign         GroupAssignService
	Metric              MetricService
	// contains filtered or unexported fields
}

Client HTTP APIs

func New

func New(httpClient *http.Client, opts ...ClientOpt) (*Client, error)

New returns a new Universe.sh API client instance.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient API

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.

func (*Client) OnRequestCompleted

func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)

OnRequestCompleted sets the DO API request completion callback

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt are options for New.

func SetBaseURL

func SetBaseURL(bu string) ClientOpt

SetBaseURL is a client option for setting the base URL.

func SetUserAgent

func SetUserAgent(ua string) ClientOpt

SetUserAgent is a client option for setting the user agent.

type CustomGroupAssignCreateRequest added in v0.0.5

type CustomGroupAssignCreateRequest struct {
	UserID string          `json:"user_id,omitempty"`
	Role   GroupAssignRole `json:"role,omitempty"`
}

CustomGroupAssignCreateRequest represents a request to create a custom GroupAssign.

type CustomGroupCreateRequest added in v0.0.5

type CustomGroupCreateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

CustomGroupCreateRequest represents a request to create a custom Groups.

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	// Error message
	Message string `json:"message"`

	// RequestID returned from the API, useful to contact support.
	RequestID string `json:"request_id"`
}

An ErrorResponse reports the error caused by an API request

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Group added in v0.0.5

type Group struct {
	ID          string          `json:"id,omitempty"`
	Name        string          `json:"name,omitempty"`
	Description string          `json:"description,omitempty"`
	Users       []User          `json:"users,omitempty"`
	CreatedAt   types.Timestamp `json:"created_at,omitempty"`
	UpdatedAt   types.Timestamp `json:"updated_at,omitempty"`
}

Group represents a Universe.sh Groups

type GroupAssign added in v0.0.5

type GroupAssign struct {
	UserID string          `json:"user_id,omitempty"`
	Role   GroupAssignRole `json:"role,omitempty"`
}

GroupAssign represents a Universe.sh User Groups

type GroupAssignRole added in v0.0.5

type GroupAssignRole string

GroupAssignRole type

const (
	RoleAdmin   GroupAssignRole = "ADMIN"
	RoleBilling GroupAssignRole = "BILLING"
	RoleRead    GroupAssignRole = "READ"
	RoleWrite   GroupAssignRole = "WRITE"
)

type GroupAssignRoot added in v0.0.5

type GroupAssignRoot struct {
	Result *GroupAssign `json:"results"`
}

GroupAssignRoot struct

type GroupAssignService added in v0.0.5

GroupAssignService is an interface for interfacing with the Groups endpoints of the Universe.sh API

type GroupAssignServiceOp added in v0.0.5

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

GroupAssignServiceOp handles communication with the Groups related methods of the Universe.sh API.

func (*GroupAssignServiceOp) Create added in v0.0.5

Create Universe.sh Group.

func (*GroupAssignServiceOp) Delete added in v0.0.5

func (s *GroupAssignServiceOp) Delete(ctx context.Context, GroupID, UserID string) (*Response, error)

Delete Universe.sh Group.

func (*GroupAssignServiceOp) Update added in v0.0.5

func (s *GroupAssignServiceOp) Update(ctx context.Context, GroupID, UserID string, updateRequest *GroupAssignUpdateRequest) (*GroupAssign, *Response, error)

Update Universe.sh Group infos.

type GroupAssignUpdateRequest added in v0.0.5

type GroupAssignUpdateRequest struct {
	UserID string          `json:"user_id,omitempty"`
	Role   GroupAssignRole `json:"role,omitempty"`
}

GroupAssignUpdateRequest represents a request to update an Groups.

type GroupRoot added in v0.0.5

type GroupRoot struct {
	Result *Group `json:"results"`
}

GroupRoot struct

type GroupService added in v0.0.5

GroupService is an interface for interfacing with the Groups endpoints of the Universe.sh API

type GroupServiceOp added in v0.0.5

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

GroupServiceOp handles communication with the Groups related methods of the Universe.sh API.

func (*GroupServiceOp) Create added in v0.0.5

func (s *GroupServiceOp) Create(ctx context.Context, createRequest *CustomGroupCreateRequest) (*Group, *Response, error)

Create Universe.sh Group.

func (*GroupServiceOp) Delete added in v0.0.5

func (s *GroupServiceOp) Delete(ctx context.Context, GroupsID string) (*Response, error)

Delete Universe.sh Group.

func (*GroupServiceOp) Get added in v0.0.5

func (s *GroupServiceOp) Get(ctx context.Context, GroupID string) (*Group, *Response, error)

Get Universe.sh Group info.

func (*GroupServiceOp) List added in v0.0.5

func (s *GroupServiceOp) List(ctx context.Context, opt *ListOptions) ([]Group, *Response, error)

List Universe.sh Groups info

func (*GroupServiceOp) Update added in v0.0.5

func (s *GroupServiceOp) Update(ctx context.Context, GroupID string, updateRequest *GroupUpdateRequest) (*Group, *Response, error)

Update Universe.sh Group infos.

type GroupUpdateRequest added in v0.0.5

type GroupUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

GroupUpdateRequest represents a request to update an Groups.

type GroupsRoot added in v0.0.5

type GroupsRoot struct {
	Results   []Group          `json:"results"`
	Metadatas *utils.Metadatas `json:"metadatas"`
}

GroupsRoot struct

type KindMetric added in v0.0.5

type KindMetric string

KindMetric type

const (
	KindMetricSatellite KindMetric = "satellite"
	KindMetricWorkspace KindMetric = "workspace"
)

type Kubernetes

type Kubernetes struct {
	Requests *Quotas `json:"requests,omitempty"`
	Limits   *Quotas `json:"limits,omitempty"`
}

Kubernetes Quotas

type LaunchSpecificationAmazon added in v0.0.2

type LaunchSpecificationAmazon struct {
	ID             string            `json:"id,omitempty"`
	NodePool       string            `json:"node_pool,omitempty"`
	SourceImage    string            `json:"source_image,omitempty"`
	RootVolumeSize int64             `json:"root_volume_size,omitempty"`
	RootVolumeType string            `json:"root_volume_type,omitempty"`
	ServiceAccount string            `json:"service_account,omitempty"`
	SecurityGroups []string          `json:"security_groups,omitempty"`
	Metadatas      map[string]string `json:"metadatas,omitempty"`
	Created        types.Timestamp   `json:"created_at,omitempty"`
}

LaunchSpecificationAmazon struct

type LaunchSpecificationGoogle added in v0.0.2

type LaunchSpecificationGoogle struct {
	ID             string            `json:"id,omitempty"`
	SourceImage    string            `json:"source_image,omitempty"`
	RootVolumeSize int64             `json:"root_volume_size,omitempty"`
	RootVolumeType string            `json:"root_volume_type,omitempty"`
	IPForwarding   bool              `json:"ip_forwarding,omitempty"`
	Metadatas      map[string]string `json:"metadatas,omitempty"`
	ServiceAccount string            `json:"service_account,omitempty"`
	Scopes         []string          `json:"scopes,omitempty"`
	Labels         map[string]string `json:"labels,omitempty"`
	Tags           []string          `json:"tags,omitempty"`
}

LaunchSpecificationGoogle struct

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type Metric added in v0.0.5

type Metric struct {
	ID           string          `json:"id,omitempty"`
	Name         string          `json:"name,omitempty"`
	Type         TypeMetric      `json:"type,omitempty"`
	MetricValues []MetricValue   `json:"metric_values,omitempty"`
	Created      types.Timestamp `json:"created_at,omitempty"`
	Updated      types.Timestamp `json:"updated_at,omitempty"`
}

Metric represents a Universe.sh Metric

type MetricCreateRequest added in v0.0.5

type MetricCreateRequest struct {
	Name         string        `json:"name,omitempty"`
	Type         TypeMetric    `json:"type,omitempty"`
	MetricValues []MetricValue `json:"metric_values,omitempty"`
}

MetricCreateRequest represents a request to create a Satellite.

type MetricService added in v0.0.5

MetricService is an interface for interfacing with the Google Satellite endpoints of the Universe.sh API

type MetricServiceOp added in v0.0.5

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

MetricServiceOp handles communication with the Satellite related methods of the Universe.sh API.

func (*MetricServiceOp) Create added in v0.0.5

func (s *MetricServiceOp) Create(ctx context.Context, kind KindMetric, namespace string, createRequest []MetricCreateRequest) ([]Metric, *Response, error)

Create Satellite

func (*MetricServiceOp) Delete added in v0.0.5

func (s *MetricServiceOp) Delete(ctx context.Context, satelliteID string) (*Response, error)

Delete Satellite.

func (*MetricServiceOp) Get added in v0.0.5

func (s *MetricServiceOp) Get(ctx context.Context, kind KindMetric, namespace, metric string) (*Metric, *Response, error)

Get individual Satellite.

func (*MetricServiceOp) List added in v0.0.5

func (s *MetricServiceOp) List(ctx context.Context, kind KindMetric, namespace string, opt *ListOptions) ([]Metric, *Response, error)

List all Satellites.

type MetricValue added in v0.0.5

type MetricValue struct {
	Value     interface{}     `json:"value,omitempty"`
	Timestamp types.Timestamp `json:"timestamp,omitempty"`
}

MetricValue represents a Universe.sh MetricValue

type NetworkInterface

type NetworkInterface struct {
	AccessConfigs []AccessConfig `json:"access_configs,omitempty"`
	AliasIPRanges []AliasIPRange `json:"alias_ip_ranges,omitempty"`
}

NetworkInterface struct

type Node added in v0.0.5

type Node struct {
	Resources *Resources         `json:"resources,omitempty"`
	Regions   map[string]*Prices `json:"regions,omitempty"`
}

Node represents a Provider Region available

type NodeService added in v0.0.5

type NodeService interface {
	List(context.Context, string) (map[string]*Node, *Response, error)
}

NodeService is an interface for interfacing with the Node endpoints of the Universe.sh API

type NodeServiceOp added in v0.0.5

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

NodeServiceOp handles communication with the node related methods of the Universe.sh API

func (*NodeServiceOp) List added in v0.0.5

func (s *NodeServiceOp) List(ctx context.Context, provider string) (map[string]*Node, *Response, error)

List all instances type available provider.

type Prices

type Prices struct {
	OnDemand      float32            `json:"ondemand,omitempty"`
	Spot          map[string]float32 `json:"spot,omitempty"`
	SpotPredicted map[string]float32 `json:"spot_predicted,omitempty"`
}

Prices struct

type Quotas

type Quotas struct {
	CPU    int64 `json:"cpu,omitempty"`
	Memory int64 `json:"memory,omitempty"`
	GPU    int64 `json:"gpu,omitempty"`
}

Quotas Resources

type Rate

type Rate struct {
	// The number of request per hour the client is currently limited to.
	Limit int `json:"limit"`

	// The number of remaining requests the client can make this hour.
	Remaining int `json:"remaining"`

	// The time at which the current rate limit will reset.
	Reset types.Timestamp `json:"reset"`
}

Rate contains the rate limit for the current client.

type Region

type Region struct {
	Name  string   `json:"name,omitempty"`
	Zones []string `json:"zones,omitempty"`
}

Region represents a Provider Region available

type RegionService added in v0.0.5

type RegionService interface {
	List(context.Context, string, *ListOptions) ([]Region, *Response, error)
}

RegionService is an interface for interfacing with the Region endpoints of the Universe.sh API

type RegionServiceOp added in v0.0.5

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

RegionServiceOp handles communication with the region related methods of the Universe.sh API

func (*RegionServiceOp) List added in v0.0.5

func (s *RegionServiceOp) List(ctx context.Context, provider string, opt *ListOptions) ([]Region, *Response, error)

List all Regions.

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type Resources

type Resources struct {
	Compute    *Quotas     `json:"compute,omitempty"`
	Kubernetes *Kubernetes `json:"kubernetes,omitempty"`
}

Resources struct

type Response

type Response struct {
	*http.Response

	// Monitoring URI
	Monitor string

	Rate
}

Response is a Universe.sh response.

type SatelliteAmazon added in v0.0.2

type SatelliteAmazon struct {
	ID      string                         `json:"id,omitempty"`
	Group   string                         `json:"group,omitempty"`
	Name    string                         `json:"name,omitempty"`
	Region  string                         `json:"region,omitempty"`
	Network string                         `json:"network,omitempty"`
	Pools   map[string]SatellitePoolAmazon `json:"pools,omitempty"`
	Tags    map[string]string              `json:"tags,omitempty"`
	Actived bool                           `json:"actived,omitempty"`
	Created types.Timestamp                `json:"created_at,omitempty"`
	Updated types.Timestamp                `json:"updated_at,omitempty"`
}

SatelliteAmazon represents a Universe.sh Satellite

type SatelliteAmazonCreateRequest added in v0.0.2

type SatelliteAmazonCreateRequest struct {
	Group       string                `json:"group,omitempty"`
	Name        string                `json:"name,omitempty"`
	Region      SatelliteAmazonRegion `json:"region,omitempty"`
	Autoscaling *Autoscaling          `json:"autoscaling,omitempty"`
	Tags        map[string]string     `json:"tags,omitempty"`
}

SatelliteAmazonCreateRequest represents a request to create a Satellite.

type SatelliteAmazonRegion added in v0.0.2

type SatelliteAmazonRegion string

SatelliteAmazonRegion type

const (
	SatelliteAmazonRegionUSEast1           SatelliteAmazonRegion = "us-east-1"
	SatelliteAmazonRegionUSEast2           SatelliteAmazonRegion = "us-east-2"
	SatelliteAmazonRegionUSWest1           SatelliteAmazonRegion = "us-west1"
	SatelliteAmazonRegionUSWest2           SatelliteAmazonRegion = "us-west2"
	SatelliteAmazonRegionCACentral1        SatelliteAmazonRegion = "ca-central-1"
	SatelliteAmazonRegionEUCentral1        SatelliteAmazonRegion = "eu-central-1"
	SatelliteAmazonRegionEUWest1           SatelliteAmazonRegion = "eu-west-1"
	SatelliteAmazonRegionEUWest2           SatelliteAmazonRegion = "eu-west-2"
	SatelliteAmazonRegionEUWest3           SatelliteAmazonRegion = "eu-west-3"
	SatelliteAmazonRegionEUNorth1          SatelliteAmazonRegion = "eu-north-1"
	SatelliteAmazonRegionAsiaEast1         SatelliteAmazonRegion = "ap-east-1"
	SatelliteAmazonRegionAsiaNorthEast1    SatelliteAmazonRegion = "ap-northeast-1"
	SatelliteAmazonRegionAsiaNorthEast2    SatelliteAmazonRegion = "ap-northeast-2"
	SatelliteAmazonRegionAsiaNorthEast3    SatelliteAmazonRegion = "ap-northeast-3"
	SatelliteAmazonRegionAsiaSouth1        SatelliteAmazonRegion = "ap-south-1"
	SatelliteAmazonRegionMiddleEastSouth1  SatelliteAmazonRegion = "me-south-1"
	SatelliteAmazonRegionSouthAmericaEast1 SatelliteAmazonRegion = "sa-east-1"
)

type SatelliteAmazonService added in v0.0.5

SatelliteAmazonService is an interface for interfacing with the Google Satellite endpoints of the Universe.sh API

type SatelliteAmazonServiceOp added in v0.0.5

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

SatelliteAmazonServiceOp handles communication with the Satellite related methods of the Universe.sh API.

func (*SatelliteAmazonServiceOp) Create added in v0.0.5

Create Satellite

func (*SatelliteAmazonServiceOp) Delete added in v0.0.5

func (s *SatelliteAmazonServiceOp) Delete(ctx context.Context, satelliteID string) (*Response, error)

Delete Satellite.

func (*SatelliteAmazonServiceOp) Get added in v0.0.5

Get individual Satellite.

func (*SatelliteAmazonServiceOp) List added in v0.0.5

List all Satellites.

type SatelliteGoogle

type SatelliteGoogle struct {
	ID            string                         `json:"id,omitempty"`
	Group         string                         `json:"group,omitempty"`
	SatelliteType SatelliteType                  `json:"satellite_type,omitempty"`
	Name          string                         `json:"name,omitempty"`
	Region        SatelliteGoogleRegion          `json:"region,omitempty"`
	Network       string                         `json:"network,omitempty"`
	Pools         map[string]SatelliteGooglePool `json:"pools,omitempty"`
	Tags          map[string]string              `json:"tags,omitempty"`
	Actived       bool                           `json:"actived,omitempty"`
	Created       types.Timestamp                `json:"created_at,omitempty"`
	Updated       types.Timestamp                `json:"updated_at,omitempty"`
}

SatelliteGoogle represents a Universe.sh Satellite

type SatelliteGoogleCreateRequest added in v0.0.2

type SatelliteGoogleCreateRequest struct {
	GroupID       string                `json:"group_id,omitempty"`
	SatelliteType SatelliteType         `json:"satellite_type,omitempty"`
	Name          string                `json:"name,omitempty"`
	Region        SatelliteGoogleRegion `json:"region,omitempty"`
	Autoscaling   *Autoscaling          `json:"autoscaling,omitempty"`
	Tags          map[string]string     `json:"tags,omitempty"`
}

SatelliteGoogleCreateRequest represents a request to create a Satellite.

type SatelliteGoogleNetworkTier added in v0.0.2

type SatelliteGoogleNetworkTier string

SatelliteGoogleNetworkTier type

const (
	SatelliteGoogleNetworkTierPremium  SatelliteGoogleNetworkTier = "PREMIUM"
	SatelliteGoogleNetworkTierStandard SatelliteGoogleNetworkTier = "STANDARD"
)

type SatelliteGoogleNetworkType added in v0.0.2

type SatelliteGoogleNetworkType string

SatelliteGoogleNetworkType type

const (
	SatelliteGoogleNetworkTypeOneToOneNAT SatelliteGoogleNetworkType = "ONE_TO_ONE_NAT"
)

type SatelliteGooglePool added in v0.0.5

type SatelliteGooglePool struct {
	ID                  string                     `json:"id,omitempty"`
	Name                string                     `json:"name,omitempty"`
	Private             bool                       `json:"private,omitempty"`
	Subnetworks         map[string]string          `json:"subnetworks,omitempty"`
	NetworkInterface    *NetworkInterface          `json:"network_interface,omitempty"`
	LaunchSpecification *LaunchSpecificationGoogle `json:"launch_specification,omitempty"`
	Autoscaling         *Autoscaling               `json:"autoscaling,omitempty"`
	Actived             bool                       `json:"actived,omitempty"`
	Created             types.Timestamp            `json:"created_at,omitempty"`
	Updated             types.Timestamp            `json:"updated_at,omitempty"`
}

SatelliteGooglePool represents the Satellite's NodePool.

type SatelliteGooglePoolService added in v0.0.5

type SatelliteGooglePoolService interface {
	List(context.Context, string, *ListOptions) ([]SatelliteGooglePool, *Response, error)
	Get(context.Context, string, string) (*SatelliteGooglePool, *Response, error)
}

SatelliteGooglePoolService is an interface for interfacing with the Google Satellite NodePool endpoints of the Universe.sh API

type SatelliteGooglePoolServiceOp added in v0.0.5

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

SatelliteGooglePoolServiceOp handles communication with the Satellite related methods of the Universe.sh API.

func (*SatelliteGooglePoolServiceOp) Get added in v0.0.5

func (s *SatelliteGooglePoolServiceOp) Get(ctx context.Context, satelliteID, poolID string) (*SatelliteGooglePool, *Response, error)

Get individual Satellite.

func (*SatelliteGooglePoolServiceOp) List added in v0.0.5

List all Google Satellites.

type SatelliteGoogleRegion added in v0.0.2

type SatelliteGoogleRegion string

SatelliteGoogleRegion type

const (
	SatelliteGoogleRegionAsiaEast1              SatelliteGoogleRegion = "asia-east1"
	SatelliteGoogleRegionAsiaEast2              SatelliteGoogleRegion = "asia-east2"
	SatelliteGoogleRegionAsiaNorthEast1         SatelliteGoogleRegion = "asia-northeast1"
	SatelliteGoogleRegionAsiaNorthEast2         SatelliteGoogleRegion = "asia-northeast2"
	SatelliteGoogleRegionAsiaSouth1             SatelliteGoogleRegion = "asia-south1"
	SatelliteGoogleRegionAsiaSouthEast1         SatelliteGoogleRegion = "asia-southeast1"
	SatelliteGoogleRegionAustraliaSouthEast1    SatelliteGoogleRegion = "australia-southeast1"
	SatelliteGoogleRegionEUNorth1               SatelliteGoogleRegion = "europe-north1"
	SatelliteGoogleRegionEUWest1                SatelliteGoogleRegion = "europe-west1"
	SatelliteGoogleRegionEUWest2                SatelliteGoogleRegion = "europe-west2"
	SatelliteGoogleRegionEUWest3                SatelliteGoogleRegion = "europe-west3"
	SatelliteGoogleRegionEUWest4                SatelliteGoogleRegion = "europe-west4"
	SatelliteGoogleRegionEUWest6                SatelliteGoogleRegion = "europe-west6"
	SatelliteGoogleRegionNorthAmericaNorthEast1 SatelliteGoogleRegion = "northamerica-northeast1"
	SatelliteGoogleRegionSouthAmericaEast1      SatelliteGoogleRegion = "southamerica-east1"
	SatelliteGoogleRegionUSCentral1             SatelliteGoogleRegion = "us-central1"
	SatelliteGoogleRegionUSEast1                SatelliteGoogleRegion = "us-east1"
	SatelliteGoogleRegionUSEast4                SatelliteGoogleRegion = "us-east4"
	SatelliteGoogleRegionUSWest1                SatelliteGoogleRegion = "us-west1"
	SatelliteGoogleRegionUSWest2                SatelliteGoogleRegion = "us-west2"
)

type SatelliteGoogleService added in v0.0.5

SatelliteGoogleService is an interface for interfacing with the Google Satellite endpoints of the Universe.sh API

type SatelliteGoogleServiceOp added in v0.0.5

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

SatellitesGoogleServiceOp handles communication with the Satellite related methods of the Universe.sh API.

func (*SatelliteGoogleServiceOp) Create added in v0.0.5

Create Satellite

func (*SatelliteGoogleServiceOp) Delete added in v0.0.5

func (s *SatelliteGoogleServiceOp) Delete(ctx context.Context, satelliteID string) (*Response, error)

Delete Satellite.

func (*SatelliteGoogleServiceOp) Get added in v0.0.5

Get individual Satellite.

func (*SatelliteGoogleServiceOp) List added in v0.0.5

List all Satellites.

type SatelliteOptions added in v0.0.2

type SatelliteOptions struct {
	Metadata bool `url:"metadata,omitempty"`
}

SatelliteOptions struct

type SatellitePoolAmazon added in v0.0.5

type SatellitePoolAmazon struct {
	Name                string                     `json:"name,omitempty"`
	Private             bool                       `json:"private,omitempty"`
	Subnetworks         map[string]string          `json:"subnetworks,omitempty"`
	LaunchSpecification *LaunchSpecificationAmazon `json:"launch_specification,omitempty"`
	Autoscaling         *Autoscaling               `json:"autoscaling,omitempty"`
	Tags                map[string]string          `json:"tags,omitempty"`
	Actived             bool                       `json:"actived,omitempty"`
	Created             types.Timestamp            `json:"created_at,omitempty"`
	Updated             types.Timestamp            `json:"updated_at,omitempty"`
}

SatellitePoolAmazon represents the Satellite's Comute.

type SatelliteState added in v0.0.4

type SatelliteState string

SatelliteState type

const (
	SatelliteStateEnabled   SatelliteState = "ENABLED"
	SatelliteStateDisabled  SatelliteState = "DISABLED"
	SatelliteStateSuspended SatelliteState = "SUSPENDED"
)

type SatelliteType added in v0.0.5

type SatelliteType string

SatelliteType type

const (
	SatelliteKubernetes SatelliteType = "KUBERNETES"
)

type TypeMetric added in v0.0.5

type TypeMetric string

TypeMetric type

const (
	TypeMetricInt    TypeMetric = "int"
	TypeMetricFloat  TypeMetric = "float"
	TypeMetricBool   TypeMetric = "bool"
	TypeMetricString TypeMetric = "string"
)

type User added in v0.0.5

type User struct {
	ID        string
	Username  string
	Firstname string
	Lastname  string
	Role      string
}

Jump to

Keyboard shortcuts

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