Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultArgsShellComp(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetCatalogs(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetCategory(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetCertificationTargets(_ *cobra.Command, _ []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetControls(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidArgsGetMetrics(_ *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 ¶
func ValidArgsGetCatalogs ¶
func ValidArgsGetCategory ¶
func ValidArgsGetCategory(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ValidArgsGetCategory returns autocomplete suggestions for selecting a category. Since a category identified by a composite key of catalog and category name, first a list of catalogs is returned, then a category to select.
func ValidArgsGetControls ¶
func ValidArgsGetControls(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ValidArgsGetControls returns autocomplete suggestions for selecting a control. Since a control identified by a composite key of catalog, category and control name, first a list of catalogs and categories is returned, then a control to select.
func ValidArgsGetMetrics ¶
func ValidArgsGetTools ¶
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 ¶
func (s *Session) Authorizer() api.Authorizer
func (*Session) HandleResponse ¶
HandleResponse handles the response and error message of an gRPC call
func (*Session) MarshalJSON ¶
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 ¶
func (s *Session) SetAuthorizer(authorizer api.Authorizer)
func (*Session) UnmarshalJSON ¶
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.