Documentation ¶
Index ¶
- func CopyFile(src, dst string) error
- func CopyFileAll(src, dst string) error
- func CreateHTTPTransport() *http.Transport
- func EnsureParentDirsExist(p string) error
- func Fqdn(hostname string) string
- func GetHostname() (string, error)
- func GetJSONSerializableMap(m interface{}) interface{}
- func GetProxyTransportFunc(p *config.Proxy) func(*http.Request) (*url.URL, error)
- func HTTPHeaders() map[string]string
- func SanitizeURL(message string) string
- func ValidHostname(hostname string) error
- type BiMap
- func (b *BiMap) AddKV(k, v interface{}) error
- func (b *BiMap) GetKV(key interface{}) (interface{}, error)
- func (b *BiMap) GetKVBimap(key interface{}) (interface{}, error)
- func (b *BiMap) GetKVReverse(key interface{}) (interface{}, error)
- func (b *BiMap) Keys() []interface{}
- func (b *BiMap) Values() []interface{}
- type NamedPipe
- type Stat
- type Stats
- type UnixNamedPipe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileAll ¶
CopyFileAll calls CopyFile, but will create necessary directories for `dst`.
func CreateHTTPTransport ¶
CreateHTTPTransport creates an *http.Transport for use in the agent
func EnsureParentDirsExist ¶
EnsureParentDirsExist makes a path immediately available for writing by creating the necessary parent directories.
func GetHostname ¶
GetHostname retrieve the host name for the Agent, trying to query these environments/api, in order: * GCE * Docker * kubernetes * os * EC2
func GetJSONSerializableMap ¶
func GetJSONSerializableMap(m interface{}) interface{}
GetJSONSerializableMap returns a JSON serializable map from a raw map
func GetProxyTransportFunc ¶
GetProxyTransportFunc return a proxy function for a http.Transport that would return the right proxy depending on the configuration.
func HTTPHeaders ¶
HTTPHeaders returns a http headers including various basic information (User-Agent, Content-Type...).
func SanitizeURL ¶
SanitizeURL sanitizes credentials from a message containing a URL, and returns a string that can be logged safely. For now, it obfuscates the API key.
func ValidHostname ¶
ValidHostname determines whether the passed string is a valid hostname. In case it's not, the returned error contains the details of the failure.
Types ¶
type BiMap ¶
type BiMap struct {
// contains filtered or unexported fields
}
BiMap provides a bidirectional map of keys and values.
func (*BiMap) GetKVBimap ¶
GetKVBimap looks for the provided key both for keys and values in the map.
The first occurrence will be returned.
func (*BiMap) GetKVReverse ¶
GetKVReverse gets key provided the value.
type NamedPipe ¶
type NamedPipe interface { Open() error Ready() bool Read(b []byte) (int, error) Write(b []byte) (int, error) Close() error }
NamedPipe interface to NamedPipes (multi-platform)
type Stats ¶
type Stats struct { Aggregated chan Stat // contains filtered or unexported fields }
Stats type structure enabling statting facilities.
type UnixNamedPipe ¶
type UnixNamedPipe struct {
// contains filtered or unexported fields
}
UnixNamedPipe unix abstraction to named pipes
func NewUnixNamedPipe ¶
func NewUnixNamedPipe(path string) (*UnixNamedPipe, error)
NewUnixNamedPipe UnixNamedPipe constructor
func (*UnixNamedPipe) Open ¶
func (p *UnixNamedPipe) Open() error
Open opens named pipe - will create it if doesn't exist
func (*UnixNamedPipe) Ready ¶
func (p *UnixNamedPipe) Ready() bool
Ready is the pipe ready to read/write?
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ecs provides metadata collection when the Agent runs on the ECS platform
|
Package ecs provides metadata collection when the Agent runs on the ECS platform |
Package executable provides information on the executable that started the process
|
Package executable provides information on the executable that started the process |