Documentation
¶
Index ¶
- Constants
- Variables
- func CloseLogger()
- func ConvertArray(s []interface{}) []interface{}
- func ConvertMap(s map[interface{}]interface{}) map[string]interface{}
- func FormatTime(time time.Time, f string) (string, error)
- func GetConfLoc() (string, error)
- func GetDataLoc() (string, error)
- func GetLoc(subdir string) (string, error)
- func GetNowInMilli() int64
- func GetTicker(duration int) *clock.Ticker
- func GetTimer(duration int) *clock.Timer
- func InitConf()
- func InterfaceToTime(i interface{}, format string) (time.Time, error)
- func InterfaceToUnixMilli(i interface{}, format string) (int64, error)
- func LoadConf(confName string) ([]byte, error)
- func MapToStruct(input, output interface{}) error
- func MapToSyncMap(m map[string]interface{}) *sync.Map
- func MessageDecode(payload []byte, format string) (map[string]interface{}, error)
- func ParseTime(t string, f string) (time.Time, error)
- func PrintMap(m map[string]string, buff *bytes.Buffer)
- func ProcessPath(p string) (string, error)
- func Read() (osrelease map[string]string, err error)
- func ReadFile(filename string) (osrelease map[string]string, err error)
- func ReadJsonUnmarshal(path string, ret interface{}) error
- func ReadString(content string) (osrelease map[string]string, err error)
- func ReadYamlUnmarshal(path string, ret interface{}) error
- func Send(logger api.Logger, client *http.Client, bodyType string, method string, ...) (*http.Response, error)
- func SyncMapToMap(sm *sync.Map) map[string]interface{}
- func TimeFromUnixMilli(t int64) time.Time
- func TimeToUnixMilli(time time.Time) int64
- func ToInt(input interface{}) (int, error)
- func ToString(input interface{}) string
- func WriteYamlMarshal(path string, data interface{}) error
- type Error
- type ErrorCode
- type KeyValue
- type KuiperConf
- type PluginDesc
- type RuleDesc
- type SqliteKVStore
- func (m *SqliteKVStore) Clean() error
- func (m *SqliteKVStore) Close() error
- func (m *SqliteKVStore) Delete(key string) error
- func (m *SqliteKVStore) Get(key string, value interface{}) (bool, error)
- func (m *SqliteKVStore) Keys() ([]string, error)
- func (m *SqliteKVStore) Open() error
- func (m *SqliteKVStore) Set(key string, value interface{}) error
- func (m *SqliteKVStore) Setnx(key string, value interface{}) error
Constants ¶
View Source
const ( FORMAT_BINARY = "binary" FORMAT_JSON = "json" DEFAULT_FIELD = "self" )
View Source
const ( StreamConf = "kuiper.yaml" KuiperBaseKey = "KuiperBaseKey" KuiperSyslogKey = "KuiperSyslogKey" MetaKey = "__meta" )
View Source
const EtcOsRelease string = "/etc/os-release"
View Source
const ISO8601 = "2006-01-02T15:04:05"
View Source
const JSISO = "2006-01-02T15:04:05.000Z07:00"
View Source
const UsrLibOsRelease string = "/usr/lib/os-release"
Variables ¶
View Source
var ( Log *logrus.Logger Config *KuiperConf IsTesting bool Clock clock.Clock LoadFileType = "relative" )
View Source
var BodyTypeMap = map[string]string{"none": "", "text": "text/plain", "json": "application/json", "html": "text/html", "xml": "application/xml", "javascript": "application/javascript", "form": ""}
Functions ¶
func CloseLogger ¶
func CloseLogger()
func ConvertArray ¶
func ConvertArray(s []interface{}) []interface{}
func ConvertMap ¶
func ConvertMap(s map[interface{}]interface{}) map[string]interface{}
func GetConfLoc ¶
func GetDataLoc ¶
func GetNowInMilli ¶
func GetNowInMilli() int64
func InterfaceToUnixMilli ¶
func MapToStruct ¶
func MapToStruct(input, output interface{}) error
* Convert a map into a struct. The output parameter must be a pointer to a struct * The struct can have the json meta data
func MapToSyncMap ¶
func MessageDecode ¶
func ProcessPath ¶
func Read ¶
Read and return os-release, trying EtcOsRelease, followed by UsrLibOsRelease. err will contain an error message if neither file exists or failed to parse
func ReadJsonUnmarshal ¶
func ReadString ¶
ReadString is similar to Read(), but takes a string to load instead
func ReadYamlUnmarshal ¶
func SyncMapToMap ¶
func TimeFromUnixMilli ¶
func TimeToUnixMilli ¶
func ToString ¶
func ToString(input interface{}) string
********** Type Cast Utilities **** TODO datetime type
func WriteYamlMarshal ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func NewErrorWithCode ¶
type KeyValue ¶
type KeyValue interface {
Open() error
Close() error
// Set key to hold string value if key does not exist otherwise return an error
Setnx(key string, value interface{}) error
// Set key to hold the string value. If key already holds a value, it is overwritten
Set(key string, value interface{}) error
Get(key string, val interface{}) (bool, error)
//Must return *common.Error with NOT_FOUND error
Delete(key string) error
Keys() (keys []string, err error)
Clean() error
}
type KuiperConf ¶
type KuiperConf struct {
Basic struct {
Debug bool `yaml:"debug"`
ConsoleLog bool `yaml:"consoleLog"`
FileLog bool `yaml:"fileLog"`
RotateTime int `yaml:"rotateTime"`
MaxAge int `yaml:"maxAge"`
Ip string `yaml:"ip"`
Port int `yaml:"port"`
RestIp string `yaml:"restIp"`
RestPort int `yaml:"restPort"`
RestTls *tlsConf `yaml:"restTls"`
Prometheus bool `yaml:"prometheus"`
PrometheusPort int `yaml:"prometheusPort"`
PluginHosts string `yaml:"pluginHosts"`
}
Rule api.RuleOption
Sink struct {
CacheThreshold int `yaml:"cacheThreshold"`
CacheTriggerCount int `yaml:"cacheTriggerCount"`
DisableCache bool `yaml:"disableCache""`
}
}
type PluginDesc ¶
type SqliteKVStore ¶
type SqliteKVStore struct {
// contains filtered or unexported fields
}
func GetSqliteKVStore ¶
func GetSqliteKVStore(fpath string) (ret *SqliteKVStore)
func (*SqliteKVStore) Clean ¶
func (m *SqliteKVStore) Clean() error
func (*SqliteKVStore) Close ¶
func (m *SqliteKVStore) Close() error
func (*SqliteKVStore) Delete ¶
func (m *SqliteKVStore) Delete(key string) error
func (*SqliteKVStore) Get ¶
func (m *SqliteKVStore) Get(key string, value interface{}) (bool, error)
func (*SqliteKVStore) Keys ¶
func (m *SqliteKVStore) Keys() ([]string, error)
func (*SqliteKVStore) Open ¶
func (m *SqliteKVStore) Open() error
func (*SqliteKVStore) Set ¶
func (m *SqliteKVStore) Set(key string, value interface{}) error
func (*SqliteKVStore) Setnx ¶
func (m *SqliteKVStore) Setnx(key string, value interface{}) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.