Documentation ¶
Index ¶
- Constants
- Variables
- func CreateFileBuffer(eventID api.EventID) error
- func DialLogServer(url string) error
- func Disconnect()
- func GetWatchLogFileSwitch(filePath string) bool
- func InsertStepLog(event *api.Event, stepevent StepEvent, state StepState, err error)
- func RemoveLogFile(filepath string) error
- func SendHeartBeat()
- func SetWatchLogFileSwitch(filePath string, watchSwitch bool)
- func WatchLogFile(filePath string, topic string, ch chan interface{})
- type HeatBeatPacket
- type PushLogPacket
- type StepEvent
- type StepState
Constants ¶
const ( // LogSpecialMark represents special mark. LogSpecialMark string = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" // LogReplaceMark represents replace mark. LogReplaceMark string = "--->" // FileBufferSize is the default size of file buffers. FileBufferSize = 64 * 1024 * 1024 )
Variables ¶
var ( // Output is used to collect log information. Output filebuffer.FileBuffer )
Functions ¶
func CreateFileBuffer ¶
CreateFileBuffer func that create a file buffer for storage log
func DialLogServer ¶
DialLogServer dial and connect to the log server e.g origin "http://120.26.103.63/" url "ws://120.26.103.63:8000/ws"
func GetWatchLogFileSwitch ¶
GetWatchLogFileSwitch set swicth of watch log file
func InsertStepLog ¶
InsertStepLog inserts the step information into the log file.
func RemoveLogFile ¶
RemoveLogFile is used to delete the log file.
func SendHeartBeat ¶
func SendHeartBeat()
SendHeartBeat send heat beat packet to log server per 30 seconds.
func SetWatchLogFileSwitch ¶
SetWatchLogFileSwitch set swicth of watch log file
func WatchLogFile ¶
WatchLogFile watch the log and prouce one line to kafka topic per 200ms
Types ¶
type HeatBeatPacket ¶
HeatBeatPacket is the type for heart_beat packet.
type PushLogPacket ¶
type PushLogPacket struct { Action string `json:"action"` Topic string `json:"topic"` Log string `json:"log"` }
PushLogPacket is the type for push_log packet.
type StepEvent ¶
type StepEvent string
StepEvent is information about step event name in creating versions
const ( CloneRepository StepEvent = "clone repository" CreateTag StepEvent = "create tag" BuildImage StepEvent = "Build image" PushImage StepEvent = "Push image" Integration StepEvent = "Integration" PreBuild StepEvent = "Pre Build" PostBuild StepEvent = "Post Build" Deploy StepEvent = "Deploy application" ApplyResource StepEvent = "Apply Resource" ParseYaml StepEvent = "Parse Yaml" )