Versions in this module Expand all Collapse all v0 v0.2.4 Dec 4, 2026 v0.2.3 Dec 1, 2026 v0.2.2 Oct 20, 2026 v0.2.1 Sep 9, 2026 Changes in this version type APIError + Errors []string v0.2.0 Sep 1, 2026 Changes in this version + func StatusError(resp *http.Response, body []byte) error type APIError + RequestID string type Cmd + func (c *Cmd) SetOutputOffset(offset int64) type Sprite + func (s *Sprite) SignalSession(ctx context.Context, sessionID, signal string) error v0.1.1 Aug 26, 2026 Changes in this version + const ErrCodeConcurrentLimitExceeded + const ErrCodeCreationRateLimited + var ErrNotStarted = errors.New("sprite: command not started") + func CreateToken(ctx context.Context, flyMacaroon, orgSlug string, inviteCode string, ...) (string, error) + func SetDebug(enabled bool) + type APIError struct + CurrentCount int + ErrorCode string + Limit int + Message string + RateLimitLimit int + RateLimitRemaining int + RateLimitReset int64 + RetryAfterHeader int + RetryAfterSeconds int + StatusCode int + UpgradeAvailable bool + UpgradeURL string + WindowSeconds int + func IsAPIError(err error) *APIError + func IsRateLimitErr(err error) *APIError + func ParseAPIError(resp *http.Response, body []byte) *APIError + func (e *APIError) Error() string + func (e *APIError) GetRetryAfterSeconds() int + func (e *APIError) IsConcurrentLimitExceeded() bool + func (e *APIError) IsCreationRateLimited() bool + func (e *APIError) IsRateLimitError() bool + type Checkpoint struct + Comment string + CreateTime time.Time + History []string + ID string + IsAuto bool + type CheckpointStream struct + func (cs *CheckpointStream) Close() error + func (cs *CheckpointStream) Next() (*StreamMessage, error) + func (cs *CheckpointStream) ProcessAll(handler func(*StreamMessage) error) error + type Client struct + func New(token string, opts ...Option) *Client + func NewClient(baseURL, token string) *Client + func (c *Client) AttachSession(spriteName string, sessionID string) *Cmd + func (c *Client) AttachSessionContext(ctx context.Context, spriteName string, sessionID string) *Cmd + func (c *Client) AttachSessionWithOrg(spriteName string, sessionID string, org *OrganizationInfo) *Cmd + func (c *Client) Close() error + func (c *Client) Create(name string) (*Sprite, error) + func (c *Client) CreateCheckpoint(ctx context.Context, spriteName string) (*CheckpointStream, error) + func (c *Client) CreateCheckpointWithComment(ctx context.Context, spriteName string, comment string) (*CheckpointStream, error) + func (c *Client) CreateService(ctx context.Context, spriteName, serviceName string, req *ServiceRequest) (*ServiceStream, error) + func (c *Client) CreateServiceWithDuration(ctx context.Context, spriteName, serviceName string, req *ServiceRequest, ...) (*ServiceStream, error) + func (c *Client) CreateSprite(ctx context.Context, name string, config *SpriteConfig) (*Sprite, error) + func (c *Client) CreateSpriteWithOrg(ctx context.Context, name string, config *SpriteConfig, org *OrganizationInfo, ...) (*Sprite, error) + func (c *Client) DeleteService(ctx context.Context, spriteName, serviceName string) error + func (c *Client) DeleteSprite(ctx context.Context, name string) error + func (c *Client) DestroySprite(ctx context.Context, name string) error + func (c *Client) FetchVersion(ctx context.Context, spriteName string) error + func (c *Client) GetCheckpoint(ctx context.Context, spriteName string, checkpointID string) (*Checkpoint, error) + func (c *Client) GetNetworkPolicy(ctx context.Context, spriteName string) (*NetworkPolicy, error) + func (c *Client) GetService(ctx context.Context, spriteName, serviceName string) (*ServiceWithState, error) + func (c *Client) GetSprite(ctx context.Context, name string) (*Sprite, error) + func (c *Client) GetSpriteWithOrg(ctx context.Context, name string, org *OrganizationInfo) (*Sprite, error) + func (c *Client) List() ([]*Sprite, error) + func (c *Client) ListAllSprites(ctx context.Context, prefix string) ([]*Sprite, error) + func (c *Client) ListAllSpritesResult(ctx context.Context, prefix string, org *OrganizationInfo) (*ListResult, error) + func (c *Client) ListAllSpritesWithOrg(ctx context.Context, prefix string, org *OrganizationInfo) ([]*Sprite, error) + func (c *Client) ListCheckpoints(ctx context.Context, spriteName string, historyFilter string) ([]*Checkpoint, error) + func (c *Client) ListCheckpointsWithOptions(ctx context.Context, spriteName string, opts ListCheckpointsOptions) ([]*Checkpoint, error) + func (c *Client) ListServices(ctx context.Context, spriteName string) ([]*ServiceWithState, error) + func (c *Client) ListSessions(ctx context.Context, spriteName string) ([]*Session, error) + func (c *Client) ListSprites(ctx context.Context, opts *ListOptions) (*SpriteList, error) + func (c *Client) ProxyPort(ctx context.Context, spriteName string, localPort, remotePort int) (*ProxySession, error) + func (c *Client) ProxyPorts(ctx context.Context, spriteName string, mappings []PortMapping) ([]*ProxySession, error) + func (c *Client) ProxySocket(ctx context.Context, network, spriteName, addr string) (net.Conn, error) + func (c *Client) RestoreCheckpoint(ctx context.Context, spriteName string, checkpointID string) (*RestoreStream, error) + func (c *Client) SignalService(ctx context.Context, spriteName, serviceName, signal string) error + func (c *Client) Sprite(name string) *Sprite + func (c *Client) SpriteVersion() string + func (c *Client) SpriteWithOrg(name string, org *OrganizationInfo) *Sprite + func (c *Client) StartService(ctx context.Context, spriteName, serviceName string) (*ServiceStream, error) + func (c *Client) StartServiceWithDuration(ctx context.Context, spriteName, serviceName string, duration time.Duration) (*ServiceStream, error) + func (c *Client) StopService(ctx context.Context, spriteName, serviceName string) (*ServiceStream, error) + func (c *Client) StopServiceWithTimeout(ctx context.Context, spriteName, serviceName string, timeout time.Duration) (*ServiceStream, error) + func (c *Client) UpdateNetworkPolicy(ctx context.Context, spriteName string, policy *NetworkPolicy) error + func (c *Client) UpdateSprite(ctx context.Context, spriteName string, req *UpdateSpriteRequest) error + func (c *Client) UpdateURLSettings(ctx context.Context, spriteName string, settings *URLSettings) error + func (c *Client) UpgradeSprite(ctx context.Context, name string) error + type Cmd struct + Args []string + Dir string + Env []string + Path string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + TextMessageHandler func([]byte) + func (c *Cmd) CombinedOutput() ([]byte, error) + func (c *Cmd) ConnectionMode() string + func (c *Cmd) ExitCode() int + func (c *Cmd) Output() ([]byte, error) + func (c *Cmd) Resize(rows, cols uint16) error + func (c *Cmd) Run() error + func (c *Cmd) SetControlMode(enable bool) error + func (c *Cmd) SetTTY(enable bool) + func (c *Cmd) SetTTYSize(rows, cols uint16) error + func (c *Cmd) Signal(signal string) error + func (c *Cmd) Start() error + func (c *Cmd) StderrPipe() (io.ReadCloser, error) + func (c *Cmd) StdinPipe() (io.WriteCloser, error) + func (c *Cmd) StdoutPipe() (io.ReadCloser, error) + func (c *Cmd) String() string + func (c *Cmd) Wait() error + type ControlMessage struct + Cols uint16 + Rows uint16 + Signal string + Type string + type CreateSpriteRequest struct + Config *SpriteConfig + Environment map[string]string + Labels []string + Name string + type CreateSpriteResponse struct + Name string + type ExecOptions struct + ControlMode bool + Environment []string + InitialCols int + InitialRows int + SessionID string + TTY bool + WorkingDir string + type ExitError struct + Code int + func (e *ExitError) Error() string + func (e *ExitError) ExitCode() int + func (e *ExitError) Sys() interface{} + type FS interface + Chmod func(name string, mode fs.FileMode) error + ChmodContext func(ctx context.Context, name string, mode fs.FileMode) error + Copy func(src, dst string) error + CopyContext func(ctx context.Context, src, dst string) error + Mkdir func(name string, perm fs.FileMode) error + MkdirAll func(path string, perm fs.FileMode) error + Remove func(name string) error + RemoveAll func(path string) error + RemoveAllContext func(ctx context.Context, path string) error + RemoveContext func(ctx context.Context, name string) error + Rename func(oldname, newname string) error + WriteFile func(name string, data []byte, perm fs.FileMode) error + WriteFileContext func(ctx context.Context, name string, data []byte, perm fs.FileMode) error + type FsChmodEntry struct + Mode string + Path string + type FsChmodResult struct + Affected []FsChmodEntry + Count int + type FsChownEntry struct + GID int + Path string + UID int + type FsChownResult struct + Affected []FsChownEntry + Count int + type FsControlOption func(*fsControlOpts) + func WithFsAsRoot(enable bool) FsControlOption + func WithFsGid(gid int) FsControlOption + func WithFsMkdirParents(enable bool) FsControlOption + func WithFsMode(mode fs.FileMode) FsControlOption + func WithFsPreserveAttrs(enable bool) FsControlOption + func WithFsRange(start, end int64) FsControlOption + func WithFsRecursive(enable bool) FsControlOption + func WithFsUid(uid int) FsControlOption + func WithFsWorkingDir(dir string) FsControlOption + type FsCopyEntry struct + Dest string + Source string + type FsCopyResult struct + Copied []FsCopyEntry + Count int + TotalBytes int64 + type FsDeleteResult struct + Count int + Deleted []string + type FsEntry struct + IsDir bool + ModTime time.Time + Mode string + Name string + Path string + Size int64 + Type string + type FsErrorResponse struct + Code string + Error string + Path string + type FsListResult struct + Count int + Entries []FsEntry + Path string + type FsReadResult struct + Data []byte + Path string + Size int64 + type FsRenameResult struct + Dest string + Source string + type FsWriteResult struct + Mode string + Path string + Size int64 + type ListCheckpointsOptions struct + HistoryFilter string + IncludeAuto bool + type ListOptions struct + ContinuationToken string + MaxResults int + Prefix string + type ListResult struct + Org *OrgInfo + Sprites []*Sprite + type NetworkPolicy struct + Rules []NetworkPolicyRule + type NetworkPolicyRule struct + Action string + Domain string + Include string + type Option func(*Client) + func WithBaseURL(url string) Option + func WithClientSignals(sig *clientsignals.Signals) Option + func WithControlInitTimeout(d time.Duration) Option + func WithDisableControl() Option + func WithHTTPClient(client *http.Client) Option + func WithNetDialContext(fn func(ctx context.Context, network, addr string) (net.Conn, error)) Option + type OrgInfo struct + Cold int + Name string + Running int + RunningLimit int + Warm int + WarmLimit int + type OrganizationInfo struct + Name string + URL string + type PortMapping struct + LocalPort int + RemoteHost string + RemotePort int + type PortNotificationMessage struct + Address string + PID int + Port int + Type string + type ProxyInitMessage struct + Host string + Port int + type ProxyManager struct + func NewProxyManager() *ProxyManager + func (pm *ProxyManager) AddSession(session *ProxySession) + func (pm *ProxyManager) CloseAll() + func (pm *ProxyManager) WaitAll() + type ProxyResponseMessage struct + Status string + Target string + type ProxySession struct + LocalPort int + RemoteHost string + RemotePort int + func (ps *ProxySession) Close() error + func (ps *ProxySession) LocalAddr() net.Addr + func (ps *ProxySession) Wait() + type RestoreStream struct + func (rs *RestoreStream) Close() error + func (rs *RestoreStream) Next() (*StreamMessage, error) + func (rs *RestoreStream) ProcessAll(handler func(*StreamMessage) error) error + type Service struct + Args []string + Cmd string + HTTPPort *int + Name string + Needs []string + type ServiceLogEvent struct + Data string + ExitCode *int + LogFiles map[string]string + Timestamp int64 + Type string + type ServiceRequest struct + Args []string + Cmd string + HTTPPort *int + Needs []string + type ServiceState struct + Error string + Name string + NextRestartAt time.Time + PID int + RestartCount int + StartedAt time.Time + Status string + type ServiceStream struct + func (ss *ServiceStream) Close() error + func (ss *ServiceStream) Next() (*ServiceLogEvent, error) + func (ss *ServiceStream) ProcessAll(handler func(*ServiceLogEvent) error) error + type ServiceWithState struct + State *ServiceState + type Session struct + BytesPerSecond float64 + Command string + Created time.Time + ID string + IsActive bool + LastActivity *time.Time + TTY bool + Workdir string + func (s *Session) GetActivityAge() time.Duration + func (s *Session) IsSessionActive() bool + type SessionList struct + Sessions []Session + type Sprite struct + BucketName string + Config *SpriteConfig + CreatedAt time.Time + Environment map[string]string + ID string + Labels []string + LastRunningAt *time.Time + LastWarmingAt *time.Time + OrganizationName string + PrimaryRegion string + Status string + URL string + URLSettings *URLSettings + UpdatedAt time.Time + func (s *Sprite) AttachSession(sessionID string) *Cmd + func (s *Sprite) AttachSessionContext(ctx context.Context, sessionID string) *Cmd + func (s *Sprite) Client() *Client + func (s *Sprite) Command(name string, arg ...string) *Cmd + func (s *Sprite) CommandContext(ctx context.Context, name string, arg ...string) *Cmd + func (s *Sprite) CreateCheckpoint(ctx context.Context) (*CheckpointStream, error) + func (s *Sprite) CreateCheckpointWithComment(ctx context.Context, comment string) (*CheckpointStream, error) + func (s *Sprite) CreateService(ctx context.Context, serviceName string, req *ServiceRequest) (*ServiceStream, error) + func (s *Sprite) CreateServiceWithDuration(ctx context.Context, serviceName string, req *ServiceRequest, ...) (*ServiceStream, error) + func (s *Sprite) Delete(ctx context.Context) error + func (s *Sprite) DeleteService(ctx context.Context, serviceName string) error + func (s *Sprite) Destroy() error + func (s *Sprite) Filesystem() FS + func (s *Sprite) FilesystemAt(workingDir string) FS + func (s *Sprite) FsChmodControl(ctx context.Context, filePath string, mode fs.FileMode, ...) (*FsChmodResult, error) + func (s *Sprite) FsChownControl(ctx context.Context, filePath string, opts ...FsControlOption) (*FsChownResult, error) + func (s *Sprite) FsCopyControl(ctx context.Context, source, dest string, opts ...FsControlOption) (*FsCopyResult, error) + func (s *Sprite) FsDeleteControl(ctx context.Context, filePath string, opts ...FsControlOption) (*FsDeleteResult, error) + func (s *Sprite) FsListControl(ctx context.Context, dirPath string, opts ...FsControlOption) (*FsListResult, error) + func (s *Sprite) FsReadControl(ctx context.Context, filePath string, opts ...FsControlOption) (*FsReadResult, error) + func (s *Sprite) FsRenameControl(ctx context.Context, source, dest string, opts ...FsControlOption) (*FsRenameResult, error) + func (s *Sprite) FsStatControl(ctx context.Context, filePath string, opts ...FsControlOption) (*FsEntry, error) + func (s *Sprite) FsWriteControl(ctx context.Context, filePath string, data []byte, opts ...FsControlOption) (*FsWriteResult, error) + func (s *Sprite) GetCheckpoint(ctx context.Context, checkpointID string) (*Checkpoint, error) + func (s *Sprite) GetNetworkPolicy(ctx context.Context) (*NetworkPolicy, error) + func (s *Sprite) GetService(ctx context.Context, serviceName string) (*ServiceWithState, error) + func (s *Sprite) ListCheckpoints(ctx context.Context, historyFilter string) ([]*Checkpoint, error) + func (s *Sprite) ListCheckpointsWithOptions(ctx context.Context, opts ListCheckpointsOptions) ([]*Checkpoint, error) + func (s *Sprite) ListServices(ctx context.Context) ([]*ServiceWithState, error) + func (s *Sprite) ListSessions(ctx context.Context) ([]*Session, error) + func (s *Sprite) Name() string + func (s *Sprite) Organization() *OrganizationInfo + func (s *Sprite) ProxyPort(ctx context.Context, localPort, remotePort int) (*ProxySession, error) + func (s *Sprite) ProxyPorts(ctx context.Context, mappings []PortMapping) ([]*ProxySession, error) + func (s *Sprite) ProxySocket(ctx context.Context, network, addr string) (net.Conn, error) + func (s *Sprite) RestoreCheckpoint(ctx context.Context, checkpointID string) (*RestoreStream, error) + func (s *Sprite) SignalService(ctx context.Context, serviceName, signal string) error + func (s *Sprite) StartService(ctx context.Context, serviceName string) (*ServiceStream, error) + func (s *Sprite) StartServiceWithDuration(ctx context.Context, serviceName string, duration time.Duration) (*ServiceStream, error) + func (s *Sprite) StopService(ctx context.Context, serviceName string) (*ServiceStream, error) + func (s *Sprite) StopServiceWithTimeout(ctx context.Context, serviceName string, timeout time.Duration) (*ServiceStream, error) + func (s *Sprite) UpdateNetworkPolicy(ctx context.Context, policy *NetworkPolicy) error + func (s *Sprite) UpdateURLSettings(ctx context.Context, settings *URLSettings) error + func (s *Sprite) Upgrade(ctx context.Context) error + type SpriteConfig struct + CPUs int + RamMB int + Region string + StorageGB int + type SpriteInfo struct + BucketName string + Config *SpriteConfig + CreatedAt time.Time + Environment map[string]string + ID string + Labels []string + LastRunningAt *time.Time + LastWarmingAt *time.Time + Name string + Organization string + PrimaryRegion string + Status string + URL string + URLSettings *URLSettings + UpdatedAt time.Time + type SpriteList struct + HasMore bool + NextContinuationToken string + Org *OrgInfo + Sprites []SpriteInfo + type StreamID byte + const StreamExit + const StreamStderr + const StreamStdin + const StreamStdinEOF + const StreamStdout + type StreamMessage struct + Data string + Error string + Type string + type URLSettings struct + Auth string + PrivateAccess string + type UpdateSpriteRequest struct + ClearLabels bool + Labels []string + URLSettings *URLSettings + type UpdateURLSettingsRequest struct + URLSettings *URLSettings v0.1.0 Aug 5, 2026