Documentation ¶
Index ¶
- func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, error)
- func IsValidEmail(email string) bool
- func JsonMarshal(t interface{}) ([]byte, error)
- func LoadFromYaml(path string, cfg interface{}) error
- func RunCmd(args ...string) ([]byte, error, int)
- type HttpClient
- type MultiError
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRequestBody ¶
BuildRequestBody builds a map[string]interface from the given `struct`. If parent is not an empty string, the final map[string]interface returned will encapsulate the built one. For example:
disk := 1 createOpts := flavors.CreateOpts{ ID: "1", Name: "m1.tiny", Disk: &disk, RAM: 512, VCPUs: 1, RxTxFactor: 1.0, } body, err := BuildRequestBody(createOpts, "flavor")
The above example can be run as-is, however it is recommended to look at how BuildRequestBody is used within Gophercloud to more fully understand how it fits within the request process as a whole rather than use it directly as shown above.
func IsValidEmail ¶
func JsonMarshal ¶
func LoadFromYaml ¶
Types ¶
type HttpClient ¶
func NewHttpClient ¶
func NewHttpClient(n int) HttpClient
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
func NewMultiErrors ¶
func NewMultiErrors() *MultiError
func (*MultiError) Add ¶
func (e *MultiError) Add(s string)
func (*MultiError) AddError ¶
func (e *MultiError) AddError(err error)
func (*MultiError) Err ¶
func (e *MultiError) Err() error
Click to show internal directories.
Click to hide internal directories.