Documentation ¶
Overview ¶
cli provides the commands for a simple CLI.
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "http://localhost:8080"
DefaultBaseURL is the default base URL for all services.
Variables ¶
View Source
var SessionKey sessionKeyType
SessionKey is the key for the session in the context.
Functions ¶
Types ¶
type Session ¶
type Session struct { PortfolioClient portfoliov1connect.PortfolioServiceClient `json:"-"` SecuritiesClient portfoliov1connect.SecuritiesServiceClient `json:"-"` // contains filtered or unexported fields }
Session holds all necessary information about the current CLI session.
func ContinueSession ¶ added in v0.2.0
ContinueSession continues a session from a file.
func FromContext ¶ added in v0.2.1
FromContext extracts the session from the context.
func NewSession ¶ added in v0.1.0
func NewSession(opts *SessionOptions) (s *Session)
NewSession creates a new session.
type SessionOptions ¶ added in v0.2.0
type SessionOptions struct { OAuth2Config *oauth2.Config HttpClient *http.Client `json:"-"` Token *oauth2.Token BaseURL string }
SessionOptions holds all options to configure a Session.
func (*SessionOptions) MergeWith ¶ added in v0.2.0
func (opts *SessionOptions) MergeWith(other *SessionOptions) *SessionOptions
MergeWith can be used to merge two SessionOptions structs.
Click to show internal directories.
Click to hide internal directories.