Documentation ¶
Index ¶
- Constants
- func ConfirmKey(entity *openpgp.Entity, config *Config) bool
- func Contains(s []int, e int) bool
- func CopyDir(source string, dest string) (err error)
- func CopyFile(source string, dest string) (err error)
- func CreateDirIfNotExists(base string, perms int) (string, error)
- func FetchKey(keyid string) error
- func GetDefaultKeyRingPath() (string, error)
- func GetDefaultSecKeyRingPath() (string, error)
- func HasKey(keyid string, entities *openpgp.EntityList) (*openpgp.Entity, error)
- func MangleCommand(command string) string
- func ReadKeyRing(keyRingPath string) (*openpgp.EntityList, error)
- func ValidateConfig(c *Config) error
- type APIClient
- type CaseResponse
- type Client
- func (client *Client) Create(configPath string, description string, private bool, pgp bool, keyid string) (interface{}, error)
- func (client *Client) Pull(id string) (map[string]string, error)
- func (client *Client) PullAll() (map[string]string, error)
- func (client *Client) Run(pgp bool, upload bool, timeout int, dryRun bool) error
- func (m *Client) RunCommand(reportPath string, command Command, wg *sync.WaitGroup)
- func (client *Client) Show() (interface{}, error)
- type Command
- type Config
- type ConfigResponse
- type DefaultAPIClient
- func (api DefaultAPIClient) Config() (*ConfigResponse, error)
- func (api DefaultAPIClient) Create(description string, private bool, config *Config) (*CaseResponse, error)
- func (api DefaultAPIClient) GetFormattedURL(prefix ...string) string
- func (api DefaultAPIClient) NewRequest(method string, url string, params []byte, validStatus []int) (*simplejson.Json, error)
- func (api DefaultAPIClient) Pull(fileId string) (*UploadFile, error)
- func (api DefaultAPIClient) Upload(filename string) error
- type DefaultEnvironment
- func (env DefaultEnvironment) GetCurrentTime() time.Time
- func (env DefaultEnvironment) GetDefaultDirectory() (string, error)
- func (env DefaultEnvironment) GetDefaultReportsDirectory() (string, error)
- func (env DefaultEnvironment) GetDefaultStoragePath() (string, error)
- func (env DefaultEnvironment) GetHomeDir() (string, error)
- func (env DefaultEnvironment) GetHostName() (string, error)
- func (env DefaultEnvironment) GetTempReportDirectory() (string, error)
- type Environment
- type File
- type PGP
- type PGPSignature
- type UploadFile
Constants ¶
View Source
const ( DefaultAPIBaseURL = "http://localhost:8080" DefaultAPIVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultKeyRingPath ¶
func MangleCommand ¶
func ReadKeyRing ¶
func ReadKeyRing(keyRingPath string) (*openpgp.EntityList, error)
func ValidateConfig ¶
Types ¶
type APIClient ¶
type APIClient interface { GetFormattedURL(prefix ...string) string NewRequest(method string, url string, params []byte, validStatus []int) (*simplejson.Json, error) Config() (*ConfigResponse, error) Create(description string, private bool, config *Config) (*CaseResponse, error) Pull(fileId string) (*UploadFile, error) Upload(filename string) error }
type CaseResponse ¶
type CaseResponse struct { Id int Description string Created string `json:",omitempty"` IsPrivate bool Signed string Config string Token string }
func NewCaseResponse ¶
func NewCaseResponse(json *simplejson.Json) (*CaseResponse, error)
type Client ¶
type Client struct { Hostname string APIClient APIClient Env Environment }
func (*Client) RunCommand ¶
type Config ¶
type Config struct { Signed string Raw string Files []File Commands []Command FilesField []string `yaml:"copy"` CommandsField []string `yaml:"run"` }
func (*Config) GetCommands ¶
type ConfigResponse ¶
func NewConfigResponse ¶
func NewConfigResponse(j *simplejson.Json) (*ConfigResponse, error)
func (*ConfigResponse) GetRawDecoded ¶
func (c *ConfigResponse) GetRawDecoded() string
func (*ConfigResponse) GetSignedDecoded ¶
func (c *ConfigResponse) GetSignedDecoded() string
type DefaultAPIClient ¶
func (DefaultAPIClient) Config ¶
func (api DefaultAPIClient) Config() (*ConfigResponse, error)
func (DefaultAPIClient) Create ¶
func (api DefaultAPIClient) Create(description string, private bool, config *Config) (*CaseResponse, error)
func (DefaultAPIClient) GetFormattedURL ¶
func (api DefaultAPIClient) GetFormattedURL(prefix ...string) string
func (DefaultAPIClient) NewRequest ¶
func (api DefaultAPIClient) NewRequest(method string, url string, params []byte, validStatus []int) (*simplejson.Json, error)
func (DefaultAPIClient) Pull ¶
func (api DefaultAPIClient) Pull(fileId string) (*UploadFile, error)
func (DefaultAPIClient) Upload ¶
func (api DefaultAPIClient) Upload(filename string) error
type DefaultEnvironment ¶
type DefaultEnvironment struct{}
func (DefaultEnvironment) GetCurrentTime ¶
func (env DefaultEnvironment) GetCurrentTime() time.Time
func (DefaultEnvironment) GetDefaultDirectory ¶
func (env DefaultEnvironment) GetDefaultDirectory() (string, error)
func (DefaultEnvironment) GetDefaultReportsDirectory ¶
func (env DefaultEnvironment) GetDefaultReportsDirectory() (string, error)
func (DefaultEnvironment) GetDefaultStoragePath ¶
func (env DefaultEnvironment) GetDefaultStoragePath() (string, error)
func (DefaultEnvironment) GetHomeDir ¶
func (env DefaultEnvironment) GetHomeDir() (string, error)
func (DefaultEnvironment) GetHostName ¶
func (env DefaultEnvironment) GetHostName() (string, error)
func (DefaultEnvironment) GetTempReportDirectory ¶
func (env DefaultEnvironment) GetTempReportDirectory() (string, error)
type Environment ¶
type PGPSignature ¶
type UploadFile ¶
Click to show internal directories.
Click to hide internal directories.