Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(ctxt context.Context, s interface{})
- func Debugf(ctxt context.Context, s string, args ...interface{})
- func Error(ctxt context.Context, s interface{})
- func Errorf(ctxt context.Context, s string, args ...interface{})
- func ExecC(ctxt context.Context, name string, arg ...string) *exec.Cmd
- func Fatal(ctxt context.Context, s interface{})
- func Fatalf(ctxt context.Context, s string, args ...interface{})
- func GenId() string
- func Info(ctxt context.Context, s interface{})
- func Infof(ctxt context.Context, s string, args ...interface{})
- func LogUploadDaemon(ip, username, password, file string, interval int) error
- func MkCtxt(reqName string) context.Context
- func PanicErr(err error)
- func Prettify(v interface{}) string
- func Tsprint(s string, m map[string]string) (string, error)
- func Unpack(b []byte, m *map[string]interface{}) error
- func Warning(ctxt context.Context, s interface{})
- func Warningf(ctxt context.Context, s string, args ...interface{})
- type ISystem
- type ReadFile
- type System
Constants ¶
View Source
const ( LoginUrl = "http://%s:7717/v2.2/login" LogUrl = "http://%s:7717/v2.2/logs_upload" LogInterval = int(time.Hour * 1) LastFile = "/var/log/datera/last" LogFiltered = "/var/log/datera/dlogs.tar.gz" )
View Source
const ( ReqName = "req" TraceId = "tid" )
Variables ¶
View Source
var ( OS ISystem FileReader ReadFile )
Binding this to an exported function for mocking purposes in tests
View Source
var (
EndLogging = make(chan bool)
)
Functions ¶
func LogUploadDaemon ¶
Types ¶
type ISystem ¶
type ISystem interface { Lstat(string) (os.FileInfo, error) Stat(string) (os.FileInfo, error) IsNotExist(error) bool MkdirAll(string, os.FileMode) error }
"OS" interface to allow for mocking purposes in tests If more OS functions are needed, just add them to this interface and the concrete implementation
Click to show internal directories.
Click to hide internal directories.