state

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultState = State{
	Version: 1,
}

Functions

func GetDefaultStateDirpath added in v0.7.7

func GetDefaultStateDirpath() (string, error)

func GetDefaultStateFilepath

func GetDefaultStateFilepath() (string, error)

func WriteStateFile

func WriteStateFile(path string, state *State) error

Types

type State

type State struct {
	// to convert across old vs. new version of `type State struct`
	Version int `json:"version"`

	// set for ingestion purpose
	IngestionToken *typesv1.EnvironmentToken `json:"ingestion_token,omitempty"`

	// update mechanism
	LatestKnownVersion           *semver.Version `json:"latest_known_version,omitempty"`
	LastestKnownVersionUpdatedAt *time.Time      `json:"latest_known_version_updated_at"`

	// prompts
	LastPromptedToSignupAt          *time.Time `json:"last_prompted_to_signup_at"`
	LastPromptedToEnableLocalhostAt *time.Time `json:"last_prompted_to_enable_localhost_at"`

	LoggedInUsername *string `json:"logged_in_username"`
	LoggedInOrgID    *int64  `json:"logged_in_org_id"`

	// preferences set in the CLI/TUI when querying
	CurrentEnvironmentID *int64 `json:"current_environment_id,omitempty"`
	// contains filtered or unexported fields
}

func ReadStateFile

func ReadStateFile(path string, dflt *State) (*State, error)

func (*State) WriteBack

func (cfg *State) WriteBack() error

Jump to

Keyboard shortcuts

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