Documentation
¶
Index ¶
- Variables
- func DeleteRequest(server string, token string, path string) error
- func DoAdminLogin(cfg *config.Config) (*config.SignedToken, error)
- func ExportRsaPrivateKeyAsPem(key *rsa.PrivateKey) (string, error)
- func ExportRsaPublicKeyAsPem(key *rsa.PublicKey) (string, error)
- func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
- func GetRequest(server string, token string, path string) ([]byte, error)
- func GetServer() string
- func GetServerFromAlias(alias string) string
- func GetTokenWithClientCert(cfg *config.Config) (*config.SignedToken, error)
- func GetValidToken(cfg *config.Config) (*config.SignedToken, error)
- func InitialiseClientKeys() error
- func ParseRsaPrivateKeyFromPem(pemValue []byte) (*rsa.PrivateKey, error)
- func ParseRsaPublicKeyFromPem(pemValue []byte) (*rsa.PublicKey, error)
- func PatchRequest(server string, token string, path string, content []byte) ([]byte, error)
- func PostRequest(server string, token string, path string, content []byte) ([]byte, error)
- func PutRequest(server string, token string, path string) ([]byte, error)
- func RefreshToken(clientId, refreshToken string, cfg *config.Config) (*config.SignedToken, error)
- func ResolveCredentials() (*config.SignedToken, error)
- func ResolveCredentialsFromAlias(alias string) (*config.SignedToken, error)
- type Client
- func (c *Client) Delete(endpoint string) error
- func (c *Client) DeleteRaw(path string) error
- func (c *Client) FetchRefreshToken(clientId, code string) (*config.SignedToken, error)
- func (c *Client) Get(endpoint string, response interface{}, headers ...Header) error
- func (c *Client) GetRaw(path string) ([]byte, error)
- func (c *Client) Post(endpoint string, request interface{}, response interface{}) error
- func (c *Client) PostRaw(path string, content []byte) ([]byte, error)
- func (c *Client) Put(endpoint string, request interface{}, response interface{}) error
- func (c *Client) PutRaw(path string) ([]byte, error)
- func (c *Client) RefreshToken(clientId, refreshToken string) (*config.SignedToken, error)
- type Header
- type IdResponse
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotLoggedIn = eris.New("user is not logged in") ErrFailedToMarshal = eris.New("failed to marshal the payload") )
Functions ¶
func DoAdminLogin ¶
func DoAdminLogin(cfg *config.Config) (*config.SignedToken, error)
func ExportRsaPrivateKeyAsPem ¶
func ExportRsaPrivateKeyAsPem(key *rsa.PrivateKey) (string, error)
func GenerateRsaKeyPair ¶
func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
func GetServerFromAlias ¶
func GetTokenWithClientCert ¶
func GetTokenWithClientCert(cfg *config.Config) (*config.SignedToken, error)
func GetValidToken ¶
func GetValidToken(cfg *config.Config) (*config.SignedToken, error)
func InitialiseClientKeys ¶
func InitialiseClientKeys() error
func ParseRsaPrivateKeyFromPem ¶
func ParseRsaPrivateKeyFromPem(pemValue []byte) (*rsa.PrivateKey, error)
func PatchRequest ¶
func PostRequest ¶
func RefreshToken ¶
func ResolveCredentials ¶
func ResolveCredentials() (*config.SignedToken, error)
func ResolveCredentialsFromAlias ¶
func ResolveCredentialsFromAlias(alias string) (*config.SignedToken, error)
Types ¶
type Client ¶
type Client struct {
Server string
// contains filtered or unexported fields
}
func (*Client) FetchRefreshToken ¶
func (c *Client) FetchRefreshToken(clientId, code string) (*config.SignedToken, error)
func (*Client) RefreshToken ¶
func (c *Client) RefreshToken(clientId, refreshToken string) (*config.SignedToken, error)
type IdResponse ¶
IdResponse can be used as a default response object where only an id is returned
Click to show internal directories.
Click to hide internal directories.