Documentation
¶
Overview ¶
Package clientutil provides some util functions to set client
Index ¶
- Constants
- func NewAuthedClient(config *config.GlobalConfig) (*client.Client, error)
- func NewAuthedClientByIssuingTokenInCli(conf *config.GlobalConfig) (*client.Client, error)
- func NewClient(config *config.GlobalConfig) (*client.Client, error)
- func TokenPath(username string) string
- type UnsupportedAuthMethodError
Constants ¶
View Source
const ( // TokenPrefix is the prefix used for cached tokens in the file system. TokenPrefix = "token" // BarearTokenKey is the key used to store the barear token in the file cache. BarearTokenKey = "barear" )
Variables ¶
This section is empty.
Functions ¶
func NewAuthedClient ¶
func NewAuthedClient( config *config.GlobalConfig, ) (*client.Client, error)
NewAuthedClient creates a new authenticated OpAMP client using the cached barear token. It retrieves the token from the file cache and initializes the client with it.
func NewAuthedClientByIssuingTokenInCli ¶
func NewAuthedClientByIssuingTokenInCli( conf *config.GlobalConfig, ) (*client.Client, error)
NewAuthedClientByIssuingTokenInCli creates a new authenticated OpAMP client by issuing a token in the CLI. It supports different authentication methods such as basic auth, manual token input, and GitHub device.
Types ¶
type UnsupportedAuthMethodError ¶
type UnsupportedAuthMethodError struct {
Method string
}
UnsupportedAuthMethodError represents an error for unsupported authentication methods.
func (*UnsupportedAuthMethodError) Error ¶
func (e *UnsupportedAuthMethodError) Error() string
Error implements the error interface for UnsupportedAuthMethodError.
Click to show internal directories.
Click to hide internal directories.