Documentation
¶
Overview ¶
Package session resolves the authenticated client and active project for a command run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory builds API clients and authenticated sessions.
func NewFactory ¶
func NewFactory(deps cliruntime.Deps) Factory
NewFactory returns a session factory using the provided runtime dependencies.
func (Factory) Authenticated ¶
Authenticated loads config, requires authentication, and builds an API client.
func (Factory) CurrentProject ¶
func (f Factory) CurrentProject() (*ProjectSession, error)
CurrentProject builds an authenticated API client for the current project.
type ProjectSession ¶
type ProjectSession struct {
Config *config.Config
API *api.Client
ProjectID uuid.UUID
// contains filtered or unexported fields
}
ProjectSession contains config, an API client, and the current project ID.
func (*ProjectSession) APIWithToken ¶
func (s *ProjectSession) APIWithToken(token string) (*api.Client, error)
APIWithToken constructs an API client for the same API URL and runtime dependencies as this project session, using the provided bearer token.
Click to show internal directories.
Click to hide internal directories.