Documentation
¶
Overview ¶
Package setup owns safe first-run initialization for a local Starport instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPathsRequired reports incomplete managed paths. ErrPathsRequired = errors.New("setup paths are required") // ErrAlreadyInitialized reports existing configuration or API key storage. ErrAlreadyInitialized = errors.New("starport is already initialized") // ErrPartialState reports an incomplete managed configuration directory. ErrPartialState = errors.New("starport setup state is incomplete") // ErrRollbackRefused reports state that does not match an initialization result. ErrRollbackRefused = errors.New("setup rollback refused") )
Functions ¶
func InitializeAPIKey ¶ added in v1.1.0
func InitializeAPIKey( ctx context.Context, store storage.KVStore, name string, ) (apikey.IssueResult, error)
InitializeAPIKey creates the first named API key in configured storage. It refuses a repository that already contains an apikey.
Types ¶
type Request ¶
type Request struct {
APIKeyName string
}
Request contains the explicit choices for local initialization.
type Result ¶
type Result struct {
APIKeyName string
ConfigFile string
DataDir string
APIKey string
// contains filtered or unexported fields
}
Result contains initialized paths and the one-time gateway credential.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service initializes one local configuration and API key store.
func (*Service) Initialize ¶
Initialize creates local configuration and one named gateway apikey. It never replaces an existing configuration file or API key store.
type State ¶
type State string
State describes the durable local setup state.
const ( // StateAbsent means the managed configuration directory does not exist. StateAbsent State = "absent" // StatePartial means the directory exists without both required artifacts. StatePartial State = "partial" // StateReady means the configuration file and API key store both exist. StateReady State = "ready" )
Click to show internal directories.
Click to hide internal directories.