Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CostQuote
- type CostQuoteUpdate
- type CostQuoteUpdateAfter
- type CostQuoteUpdateAfterUsageDimension
- type CostQuoteUpdateBefore
- type CostQuoteUpdateBeforeUsageDimension
- type CostQuoteUpdateDiff
- type CostQuoteUpdateDiffUsageDimension
- type CostQuoteUpdateDiffUsageDimensionAfter
- type CostQuoteUpdateDiffUsageDimensionBefore
- type CostQuoteUsageDimension
- type Error
- type Pagination
- type RegionName
- type ResourceStatus
- type SourceIPRuleParam
- type SourceIPRuleResponse
Constants ¶
const RegionNameUsSva2 = shared.RegionNameUsSva2
Equals "us-sva-2"
const ResourceStatusCreating = shared.ResourceStatusCreating
Equals "creating"
const ResourceStatusDeleted = shared.ResourceStatusDeleted
Equals "deleted"
const ResourceStatusDeleting = shared.ResourceStatusDeleting
Equals "deleting"
const ResourceStatusError = shared.ResourceStatusError
Equals "error"
const ResourceStatusPending = shared.ResourceStatusPending
Equals "pending"
const ResourceStatusReady = shared.ResourceStatusReady
Equals "ready"
const ResourceStatusUpdating = shared.ResourceStatusUpdating
Equals "updating"
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (NIRVANA_LABS_API_KEY, NIRVANA_LABS_BASE_URL). This should be used to initialize new clients.
func Opt ¶ added in v1.1.0
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Client ¶
type Client struct {
Options []option.RequestOption
User user.UserService
APIKeys api_keys.APIKeyService
Operations operations.OperationService
Organizations organizations.OrganizationService
Quotas quotas.QuotaService
Usage usage.UsageService
AuditLogs audit_logs.AuditLogService
Projects projects.ProjectService
Regions regions.RegionService
InstanceTypes instance_types.InstanceTypeService
Compute compute.ComputeService
Networking networking.NetworkingService
RPCNodes rpc_nodes.RPCNodeService
NKS nks.NKSService
}
Client creates a struct with services and top level methods that help with interacting with the Nirvana Labs API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (NIRVANA_LABS_API_KEY, NIRVANA_LABS_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values] will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CostQuote ¶ added in v1.88.6
Cost quote returned by POST /cost.
This is an alias to an internal type.
type CostQuoteUpdate ¶ added in v1.88.6
type CostQuoteUpdate = shared.CostQuoteUpdate
Cost quote returned by PATCH /:id/cost: the current-state quote, the post-update quote, and the signed diff.
This is an alias to an internal type.
type CostQuoteUpdateAfter ¶ added in v1.88.6
type CostQuoteUpdateAfter = shared.CostQuoteUpdateAfter
Quote for the proposed (post-update) resource state.
This is an alias to an internal type.
type CostQuoteUpdateAfterUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateAfterUsageDimension = shared.CostQuoteUpdateAfterUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type CostQuoteUpdateBefore ¶ added in v1.88.6
type CostQuoteUpdateBefore = shared.CostQuoteUpdateBefore
Quote for the proposed (post-update) resource state.
This is an alias to an internal type.
type CostQuoteUpdateBeforeUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateBeforeUsageDimension = shared.CostQuoteUpdateBeforeUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type CostQuoteUpdateDiff ¶ added in v1.88.6
type CostQuoteUpdateDiff = shared.CostQuoteUpdateDiff
Per-dimension and total deltas: after minus before.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimension ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimension = shared.CostQuoteUpdateDiffUsageDimension
Per-dimension diff entry. Both before and after are always present.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimensionAfter ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimensionAfter = shared.CostQuoteUpdateDiffUsageDimensionAfter
Priced row after the update. Always present.
This is an alias to an internal type.
type CostQuoteUpdateDiffUsageDimensionBefore ¶ added in v1.88.6
type CostQuoteUpdateDiffUsageDimensionBefore = shared.CostQuoteUpdateDiffUsageDimensionBefore
Priced row after the update. Always present.
This is an alias to an internal type.
type CostQuoteUsageDimension ¶ added in v1.88.6
type CostQuoteUsageDimension = shared.CostQuoteUsageDimension
Priced row for a single usage dimension emitted by a resource.
This is an alias to an internal type.
type Pagination ¶ added in v1.21.0
type Pagination = shared.Pagination
Pagination response details.
This is an alias to an internal type.
type RegionName ¶
type RegionName = shared.RegionName
Region the resource is in.
This is an alias to an internal type.
type ResourceStatus ¶
type ResourceStatus = shared.ResourceStatus
Status of the resource.
This is an alias to an internal type.
type SourceIPRuleParam ¶ added in v1.35.0
type SourceIPRuleParam = shared.SourceIPRuleParam
IP filter rules.
This is an alias to an internal type.
type SourceIPRuleResponse ¶ added in v1.54.0
type SourceIPRuleResponse = shared.SourceIPRuleResponse
IP filter rules.
This is an alias to an internal type.
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|