Documentation
¶
Overview ¶
Package renderapi talks to Render's v1 API: a service's environment, and the deploys that restart it.
Render is not enveloped like Cloudflare — a failure is an HTTP status with a JSON message — so the two transports stay separate rather than sharing an abstraction that fits neither.
Index ¶
- func TokenFromCLI() string
- type Client
- func (c *Client) Deploy(ctx context.Context, serviceID, image string) (string, error)
- func (c *Client) DeployStatus(ctx context.Context, serviceID, deployID string) (DeployStatus, error)
- func (c *Client) EnvVars(ctx context.Context, serviceID string) (map[string]string, error)
- func (c *Client) Service(ctx context.Context, serviceID string) (Service, error)
- func (c *Client) SetEnvVar(ctx context.Context, serviceID, key, value string) error
- func (c *Client) String() string
- type DeployStatus
- type EnvVar
- type Error
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TokenFromCLI ¶
func TokenFromCLI() string
TokenFromCLI reads ~/.render/cli.yaml. The value is returned, never logged.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DeployStatus ¶
func (*Client) EnvVars ¶
EnvVars returns the service's whole environment, keyed by name.
The values come back too — Render's API does not redact them — so callers must compare and discard rather than print. Nothing in upkeep renders a value from this map.
func (*Client) SetEnvVar ¶
SetEnvVar adds or updates one variable, leaving every other one alone.
Render also offers a whole-environment PUT. upkeep does not use it: one wrong call there wipes the variables the platform set itself, and a tool that can silently delete DATABASE_URL is not one to trust with a production service.
type DeployStatus ¶
DeployStatus is where a deploy got to. Render reports several distinct failures and they are worth keeping apart: a build that never compiled and a deploy that could not start are different problems.
func (DeployStatus) Failed ¶
func (d DeployStatus) Failed() bool
Failed reports the statuses a deploy never leaves.
func (DeployStatus) Live ¶
func (d DeployStatus) Live() bool
Live reports the one status that means the new code is serving traffic.