state

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	Version string
	Config  *config.Config
	Logger  *slog.Logger
	// contains filtered or unexported fields
}

State holds shared dependencies for all commands.

func New

func New(version string) *State

New creates a new State with the given version string.

func (*State) AccountID

func (s *State) AccountID() (string, error)

AccountID returns the configured account ID or an error.

func (*State) Client

func (s *State) Client(ctx context.Context) (*qcloudapi.Client, error)

Client returns the gRPC client, creating it lazily on first call.

func (*State) SetClient

func (s *State) SetClient(c *qcloudapi.Client)

SetClient injects a pre-built client, bypassing lazy creation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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