Documentation
¶
Overview ¶
Package writer is an file library for appending file.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
Writer is the interface of writer implementations
func NewWriter ¶
NewWriter creates a new writer instance of basicWriter match Writer interface
Example ¶
example of creating new writer
conf := config.Config{
PathTpl: "{dir}/{filename}{base_ext}{write_ext}",
BaseExt: ".msg",
WriteExt: "",
PathInfo: map[string]string{
"{dir}": os.Getenv("DIR"),
"{filename}": os.Getenv("FILENAME"),
},
UpdateMoment: "00:01:00",
}
writer := NewWriter("心跳消息文件", conf)
writer.Start()
writer.WriteString("this is string")
writer.WriteBytes([]byte("this is bytes"))
writer.Stop()
Click to show internal directories.
Click to hide internal directories.