Categorygithub.com/universe-sh/client-go
modulepackage
0.1.0
Repository: https://github.com/universe-sh/client-go.git
Documentation: pkg.go.dev

# README

Go API client for openapi

Universe.sh houston API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./openapi"

Documentation for API Endpoints

All URIs are relative to http://api-houston-$.endpoints.$.cloud.goog

ClassMethodHTTP requestDescription
AccountApiListAccountGet /v1/account
EventsApiAddEventsPost /v1/events
EventsApiListEventsGet /v1/events
EventsApiReadEventGet /v1/events/{event}
SatellitesApiAddPoolsPost /v1/satellites/{cloud}/{satellite}/pools
SatellitesApiAddSatellitesPost /v1/satellites/{cloud}
SatellitesApiCreateMetricsPost /v1/satellites/{cloud}/{satellite}/{pool}/metrics
SatellitesApiDeletePoolDelete /v1/satellites/{cloud}/{satellite}/{pool}
SatellitesApiDeleteSatelliteDelete /v1/satellites/{cloud}/{satellite}
SatellitesApiListMetricsGet /v1/satellites/{cloud}/{satellite}/{pool}/metrics
SatellitesApiListPoolsGet /v1/satellites/{cloud}/{satellite}/pools
SatellitesApiListSatellitesGet /v1/satellites/{cloud}
SatellitesApiReadPoolGet /v1/satellites/{cloud}/{satellite}/{pool}
SatellitesApiReadSatelliteGet /v1/satellites/{cloud}/{satellite}
SatellitesApiUpdatePoolPut /v1/satellites/{cloud}/{satellite}/{pool}
SatellitesApiUpdateSatellitePut /v1/satellites/{cloud}/{satellite}
TeamsApiAddTeamsPost /v1/teams
TeamsApiDeleteInvitationsDelete /v1/teams/invitations/{invitation}
TeamsApiDeleteTeamDelete /v1/teams/{team}
TeamsApiListInvitationsGet /v1/teams/{team}/invitations
TeamsApiListInvoicesGet /v1/teams/{team}/invoices
TeamsApiListTeamsGet /v1/teams
TeamsApiReadInvitationsGet /v1/teams/invitations/{invitation}
TeamsApiReadInvitationsAcceptGet /v1/teams/invitations/{invitation}/accept
TeamsApiReadInvoiceGet /v1/teams/{team}/invoices/{invoice}
TeamsApiReadPreferencesGet /v1/teams/{team}/preferences
TeamsApiReadTeamGet /v1/teams/{team}
TeamsApiUpdateInvitationsPut /v1/teams/invitations/{invitation}
TeamsApiUpdatePreferencesPut /v1/teams/{team}/preferences
TeamsApiUpdateTeamPut /v1/teams/{team}

Documentation For Models

Documentation For Authorization

okta_jwt

  • Type: OAuth
  • Flow: implicit
  • Authorization URL:
  • Scopes: N/A

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

Author

[email protected]

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewConfiguration returns a new Configuration object.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.

# Structs

Account struct for Account.
AccountDefaultTeam struct for AccountDefaultTeam.
APIClient manages communication with the Universe.sh houston API API v1.0.0 In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
Event struct for Event.
Generic struct for Generic.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
Invitation struct for Invitation.
InvitationInvitedBy struct for InvitationInvitedBy.
InvitationTeam struct for InvitationTeam.
InvitationUser struct for InvitationUser.
Invoice struct for Invoice.
Metric struct for Metric.
MetricData struct for MetricData.
Pool struct for Pool.
PoolAutoscaling struct for PoolAutoscaling.
PoolLaunchSpecification struct for PoolLaunchSpecification.
PoolLaunchSpecificationConfig struct for PoolLaunchSpecificationConfig.
PoolLaunchSpecificationRootDisk struct for PoolLaunchSpecificationRootDisk.
Preferences struct for Preferences.
Satellite struct for Satellite.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
Team struct for Team.
TeamUsers struct for TeamUsers.

# Type aliases

AccountApiService AccountApi service.
EventsApiService EventsApi service.
SatellitesApiService SatellitesApi service.
TeamsApiService TeamsApi service.