Documentation
¶
Index ¶
- Constants
- func CheckError(err error)
- func CheckRequiredFlags(c *cli.Context, flags []string)
- func CheckReturnCode(res int, mesg []byte)
- func CheckStandardStatus(status int, mesg []byte) error
- func ExecCode(code string, path string, filename string) (output string, exitCode int, startedAt time.Time, finishedAt time.Time)
- func FileExists(name string) bool
- func FlagConvertParams(c *cli.Context) *map[string]interface{}
- func FlagConvertParamsJSON(c *cli.Context, jsonFlags []string) (*map[string]interface{}, error)
- func FlagsRequired(c *cli.Context, flags []string)
- func ItemConvertParams(item interface{}) (*map[string]interface{}, error)
- func JSONParam(param string) (interface{}, error)
- func RunCmd(command string) (output string, exitCode int, startedAt time.Time, finishedAt time.Time)
- func RunFile(command string) (output string, exitCode int, startedAt time.Time, finishedAt time.Time)
- func ScrapeErrorMessage(message string, regExpression string) string
- func Unzip(archive, target string) error
- type Cert
- type ConcertoService
- type Config
- type HTTPConcertoservice
- func (hcs *HTTPConcertoservice) Delete(path string) ([]byte, int, error)
- func (hcs *HTTPConcertoservice) Get(path string) ([]byte, int, error)
- func (hcs *HTTPConcertoservice) GetFile(path string, directoryPath string) (string, int, error)
- func (hcs *HTTPConcertoservice) Post(path string, payload *map[string]interface{}) ([]byte, int, error)
- func (hcs *HTTPConcertoservice) Put(path string, payload *map[string]interface{}) ([]byte, int, error)
- type MockConcertoService
- func (m *MockConcertoService) Delete(path string) ([]byte, int, error)
- func (m *MockConcertoService) Get(path string) ([]byte, int, error)
- func (m *MockConcertoService) GetFile(path string, directoryPath string) (string, int, error)
- func (m *MockConcertoService) Post(path string, payload *map[string]interface{}) ([]byte, int, error)
- func (m *MockConcertoService) Put(path string, payload *map[string]interface{}) ([]byte, int, error)
Constants ¶
const (
TimeStampLayout = "2006-01-02T15:04:05.000000-07:00"
)
const VERSION = "0.3.62"
Variables ¶
This section is empty.
Functions ¶
func CheckRequiredFlags ¶
CheckRequiredFlags checks for required flags, and show usage if requirements not met
func CheckReturnCode ¶
func CheckStandardStatus ¶
CheckStandardStatus return error if status is not OK
func FlagConvertParams ¶
FlagConvertParams converts cli parameters in API callable params
func FlagConvertParamsJSON ¶
FlagConvertParamsJSON converts cli parameters in API callable params, and encodes JSON parameters
func ItemConvertParams ¶
ItemConvertParams converts API items into map of interface
func ScrapeErrorMessage ¶
Types ¶
type Cert ¶
type Cert struct { Cert string `xml:"cert,attr"` Key string `xml:"key,attr"` Ca string `xml:"server_ca,attr"` }
Cert stores cert files location
type ConcertoService ¶
type ConcertoService interface { Post(path string, payload *map[string]interface{}) ([]byte, int, error) Put(path string, payload *map[string]interface{}) ([]byte, int, error) Delete(path string) ([]byte, int, error) Get(path string) ([]byte, int, error) GetFile(path string, directoryPath string) (string, int, error) }
ConcertoService defines actions to be performed by web service manager
type Config ¶
type Config struct { XMLName xml.Name `xml:"concerto"` APIEndpoint string `xml:"server,attr"` LogFile string `xml:"log_file,attr"` LogLevel string `xml:"log_level,attr"` Certificate Cert `xml:"ssl"` ConfLocation string ConfFile string IsHost bool ConcertoURL string }
Config stores configuration file contents
func GetConcertoConfig ¶
GetConcertoConfig returns concerto configuration
func InitializeConcertoConfig ¶
InitializeConcertoConfig creates the concerto configuration structure
func (*Config) IsConfigReady ¶
IsConfigReady returns whether configurations items are filled
func (*Config) IsConfigReadySetup ¶
IsConfigReadySetup returns whether we can use setup command
type HTTPConcertoservice ¶
type HTTPConcertoservice struct {
// contains filtered or unexported fields
}
HTTPConcertoservice web service manager.
func NewHTTPConcertoService ¶
func NewHTTPConcertoService(config *Config) (hcs *HTTPConcertoservice, err error)
NewHTTPConcertoService creates new http Concerto client based on config
func (*HTTPConcertoservice) Delete ¶
func (hcs *HTTPConcertoservice) Delete(path string) ([]byte, int, error)
Delete sends DELETE request to Concerto API
func (*HTTPConcertoservice) Get ¶
func (hcs *HTTPConcertoservice) Get(path string) ([]byte, int, error)
Get sends GET request to Concerto API
type MockConcertoService ¶
MockConcertoService service manager.
func (*MockConcertoService) Delete ¶
func (m *MockConcertoService) Delete(path string) ([]byte, int, error)
Delete mocks DELETE request to Concerto API
func (*MockConcertoService) Get ¶
func (m *MockConcertoService) Get(path string) ([]byte, int, error)
Get mocks GET request to Concerto API