flyapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package flyapi talks to Fly.io's Machines API: an app's secrets, and the releases that restart it.

Fly names things differently from Render on purpose, and the difference matters to what upkeep can honestly report. Fly calls them *secrets*, and the API never returns a value — only a name and a digest. So upkeep can tell you that a secret is missing, and that one exists, but not whether its value is the one you meant. That limit is the provider's, not a gap here, and every plan says so rather than implying a comparison it did not make.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFromCLI

func TokenFromCLI() string

TokenFromCLI reads the session `fly auth login` already stored, so an operator who can run flyctl needs no second credential on disk.

Types

type App

type App struct {
	Name   string `json:"name"`
	Status string `json:"status"`
}

App is the subset upkeep reads.

type Client

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

func New

func New(baseURL, token string) *Client

func (*Client) App

func (c *Client) App(ctx context.Context, app string) (App, error)

func (*Client) Secrets

func (c *Client) Secrets(ctx context.Context, app string) (map[string]Secret, error)

Secrets lists the names an app has set.

func (*Client) SetSecret

func (c *Client) SetSecret(ctx context.Context, app, name, value string) error

SetSecret sets one secret. Fly stages secrets and applies them on the next release, which is why setting one is not the same as it being live.

func (*Client) String

func (c *Client) String() string

String redacts the token so that printing a Client cannot leak it.

type Error

type Error struct {
	Status   int
	Message  string
	Endpoint string
}

func (*Error) Error

func (e *Error) Error() string

type Secret

type Secret struct {
	Name   string `json:"label"`
	Digest string `json:"digest"`
	Type   string `json:"type"`
}

Secret is what Fly will tell you: a name, a kind, and a digest. Never a value.

Jump to

Keyboard shortcuts

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