Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultArgsShellComp(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetCloudServices(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetMetrics(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetRequirements(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetTools(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)
- type Session
- func (s *Session) Authorizer() api.Authorizer
- func (*Session) HandleResponse(msg proto.Message, err error) error
- func (s *Session) MarshalJSON() ([]byte, error)
- func (s *Session) Save() (err error)
- func (s *Session) SetAuthorizer(authorizer api.Authorizer)
- func (s *Session) UnmarshalJSON(data []byte) (err error)
Constants ¶
const SessionFolderFlag = "session-directory"
Variables ¶
var DefaultSessionFolder string
var Output io.Writer = os.Stdout
Functions ¶
func DefaultArgsShellComp ¶ added in v1.3.2
func ValidArgsGetCloudServices ¶ added in v1.3.11
func ValidArgsGetMetrics ¶ added in v1.3.2
func ValidArgsGetRequirements ¶ added in v1.4.0
func ValidArgsGetTools ¶ added in v1.3.2
Types ¶
type Session ¶
type Session struct { *grpc.ClientConn *oauth2.Config // URL is the URL of the gRPC server to connect to URL string `json:"url"` Folder string `json:"-"` // contains filtered or unexported fields }
func ContinueSession ¶
func NewSession ¶
func (*Session) Authorizer ¶ added in v1.4.0
func (s *Session) Authorizer() api.Authorizer
func (*Session) HandleResponse ¶
HandleResponse handles the response and error message of an gRPC call
func (*Session) MarshalJSON ¶ added in v1.4.0
MarshalJSON is custom JSON marshalling implementation that gives us more control over the fields we want to serialize. The core problem is that we want to serialize our token, e.g. to store a session state for our clients, but we do not want to export the token field in our struct. Exporting the field would create problems in multi-threaded environments. Therefore, access is only allowed through the Token() function, which keeps the token synchronized using a mutex.
func (*Session) SetAuthorizer ¶ added in v1.4.0
func (s *Session) SetAuthorizer(authorizer api.Authorizer)
func (*Session) UnmarshalJSON ¶ added in v1.4.0
UnmarshalJSON is custom JSON marshalling implementation that gives us more control over the fields we want to deserialize. See MarshalJSON for a detailed explanation, why this is necessary.