Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
func Command(log api.LogService, action func(api.DatabaseService, api.StorageService, *api.Account))
Command represents a basic utility command.
func IsPiped ¶
func IsPiped() bool
IsPiped returns whether the command was started with piped input.
func ReadSectionData ¶ added in v1.0.8
ReadSectionData reads in a sub-section of test data, returning a partial form.
Types ¶
type WebClient ¶
type WebClient struct { Address string Username string Password string UseSessionToken bool SessionToken string // contains filtered or unexported fields }
WebClient is a basic web client to be used with various utility functionality.
func NewWebClient ¶
func NewWebClient(config WebClientConfig) *WebClient
NewWebClient returns a configured web client.
func (*WebClient) Authenticate ¶
func (wc *WebClient) Authenticate()
Authenticate against the RESTful service with basic authentication.
func (*WebClient) Form ¶
func (wc *WebClient) Form() json.RawMessage
Form returns the entire application as a JSON structure.
func (*WebClient) GetInformation ¶
func (wc *WebClient) GetInformation()
GetInformation will ask for more information if not already known.
func (*WebClient) Save ¶
func (wc *WebClient) Save(payload json.RawMessage)
Save a JSON structure to the RESTful service.
type WebClientConfig ¶
WebClientConfig is used to configure a web client.
type WebClientConfigFlags ¶
WebClientConfigFlags is a struct used for configuring flags the same across different binaries. By calling SetupWebClientFlags() followed by flag.Parse() followed by wccFlags.Parse() we can use the same flags to configure several binaries that are using
func SetupWebClientFlags ¶
func SetupWebClientFlags(cmdName string, usage string) WebClientConfigFlags
SetupWebClientFlags configures the flags package for the flags common to all binaries using WebClient. It also sets the usage, pass in any extra usage that needs to be inserted. It must be called in main() before flag.Parse has been called. Then, after flag.Parse() has been called, you can call Parse() on the returned configFlags
func (WebClientConfigFlags) ConfiguredClient ¶
func (f WebClientConfigFlags) ConfiguredClient() *WebClient
ConfiguredClient takes the parsed flags and creates a NewWebClient configured accordingly