Documentation
¶
Index ¶
- func HTTPClientBuilder(opts *clioptions.CLIOptions) (*http.Client, error)
- func ParseResponseBody(contextName string, body io.Reader, out interface{}) error
- type Auth
- type IAuth
- type MiaClient
- type SessionHandler
- func (s *SessionHandler) ExecuteRequest() (*http.Response, error)
- func (s *SessionHandler) Get() *SessionHandler
- func (s *SessionHandler) GetContext() string
- func (s *SessionHandler) Post(body io.Reader) *SessionHandler
- func (s *SessionHandler) WithAuthentication(url, providerID string, b browser.URLOpener) *SessionHandler
- func (s *SessionHandler) WithBody(body io.Reader) *SessionHandler
- func (s *SessionHandler) WithClient(c *http.Client) *SessionHandler
- func (s *SessionHandler) WithContext(ctx string) *SessionHandler
- func (s *SessionHandler) WithURL(url string) *SessionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClientBuilder ¶
func HTTPClientBuilder(opts *clioptions.CLIOptions) (*http.Client, error)
HTTPClientBuilder creates an HTTP client from the given CLI options
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) Authenticate ¶
type MiaClient ¶
type MiaClient struct {
SessionHandler SessionHandler
}
MiaClient is the type spec for miactl custom client
func ConfigureDefaultMiaClient ¶
func ConfigureDefaultMiaClient(opts *clioptions.CLIOptions, uri string) (*MiaClient, error)
ConfigureDefaultMiaClient creates a MiaClient object with default options
func FakeMiaClient ¶
FakeMiaClient creates a fake MiaClient with a fake SessionHandler for testing purposes
func NewMiaClientBuilder ¶
func NewMiaClientBuilder() *MiaClient
NewMiaClientBuilder returns an empty MiaClient
func (*MiaClient) GetSession ¶
func (m *MiaClient) GetSession() *SessionHandler
GetSession returns the MiaClient SessionHandler
func (*MiaClient) WithSessionHandler ¶
func (m *MiaClient) WithSessionHandler(s SessionHandler) *MiaClient
WithSessionHandler sets the MiaClient SessionHandler
type SessionHandler ¶
type SessionHandler struct {
// contains filtered or unexported fields
}
SessionHandler is the type spec for miactl HTTP sessions
func ConfigureDefaultSessionHandler ¶
func ConfigureDefaultSessionHandler(opts *clioptions.CLIOptions, contextName, uri string) (*SessionHandler, error)
ConfigureDefaultSessionHandler returns a session handler with default settings
func FakeSessionHandler ¶
func FakeSessionHandler(url string) *SessionHandler
func NewSessionHandler ¶
func NewSessionHandler(url string) (*SessionHandler, error)
NewSessionHandler returns a SessionHandler with the specified URL
func (*SessionHandler) ExecuteRequest ¶
func (s *SessionHandler) ExecuteRequest() (*http.Response, error)
ExecuteRequest executes the HTTP request with the info in the SessionHandler object.
func (*SessionHandler) Get ¶
func (s *SessionHandler) Get() *SessionHandler
Get sets the SessionHandler method to HTTP GET
func (*SessionHandler) GetContext ¶
func (s *SessionHandler) GetContext() string
GetContext returns the SessionHandler miactl context
func (*SessionHandler) Post ¶
func (s *SessionHandler) Post(body io.Reader) *SessionHandler
Post sets the SessionHandler method to HTTP POST
func (*SessionHandler) WithAuthentication ¶
func (s *SessionHandler) WithAuthentication(url, providerID string, b browser.URLOpener) *SessionHandler
WithAuthentication initializes the SessionHandler auth field
func (*SessionHandler) WithBody ¶
func (s *SessionHandler) WithBody(body io.Reader) *SessionHandler
WithBody sets the SessionHandler request body
func (*SessionHandler) WithClient ¶
func (s *SessionHandler) WithClient(c *http.Client) *SessionHandler
WithClient sets the SessionHandler HTTP client
func (*SessionHandler) WithContext ¶
func (s *SessionHandler) WithContext(ctx string) *SessionHandler
WithContext sets the SessionHandler miactl context
func (*SessionHandler) WithURL ¶
func (s *SessionHandler) WithURL(url string) *SessionHandler