Documentation ¶
Index ¶
- Variables
- func DeleteRequest(server string, token string, path string) error
- func DoAdminLogin(cfg *config.Config) (*oauth2.Token, error)
- func DoClientLogin(cfg *config.Config) (*oauth2.Token, error)
- func ExportRsaPrivateKeyAsPem(key *rsa.PrivateKey) (string, error)
- func ExportRsaPublicKeyAsPem(key *rsa.PublicKey) (string, error)
- func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
- func Get[T any](server string, token string, path string) (T, error)
- func GetRequest(server string, token string, path string) ([]byte, error)
- func GetServer() string
- func GetServerFromAlias(alias string) string
- func GetTokenWithClientCert(cfg *config.Config) (*oauth2.Token, error)
- func GetValidToken(cfg *config.Config) (*oauth2.Token, 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 PostRequestWithHeaders(server string, token string, path string, content []byte, ...) ([]byte, error)
- func Put[T any](server string, token string, path string) (T, error)
- func PutRequest(server string, token string, path string) ([]byte, error)
- func ResolveCredentials() (*oauth2.Token, error)
- func ResolveCredentialsFromAlias(alias string) (*oauth2.Token, error)
- type Client
- func (c *Client) Delete(endpoint string) error
- func (c *Client) DeleteRaw(path string) 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)
- 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 ExportRsaPrivateKeyAsPem ¶
func ExportRsaPrivateKeyAsPem(key *rsa.PrivateKey) (string, error)
func GenerateRsaKeyPair ¶
func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey)
func Get ¶ added in v0.17.0
Get is a shortcut for GetRequest but is using generics to make returning a struct easier
func GetServerFromAlias ¶
func GetTokenWithClientCert ¶
func InitialiseClientKeys ¶
func InitialiseClientKeys() error
func ParseRsaPrivateKeyFromPem ¶
func ParseRsaPrivateKeyFromPem(pemValue []byte) (*rsa.PrivateKey, error)
func PatchRequest ¶
func PostRequest ¶
func PostRequestWithHeaders ¶ added in v0.16.0
func Put ¶ added in v0.17.0
Put is a shortcut for PutRequest but is using generics to make returning a struct easier
func ResolveCredentials ¶
Types ¶
type Client ¶
type Client struct {
Server string
}
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.