log

package
v0.0.0-...-964918b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogSpecialMark string = "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
	LogReplaceMark string = "--->"
)

Variables

This section is empty.

Functions

func DialLogServer

func DialLogServer(url string) error

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 Disconnect

func Disconnect()

Disconnect dicconnect websocket from log server

func GetWatchLogFileSwitch

func GetWatchLogFileSwitch(filePath string) bool

GetWatchLogFileSwitch set swicth of watch log file

func InsertStepLog

func InsertStepLog(event *api.Event, stepevent StepEvent, state StepState, err error)

InsertStepLog inserts the step information into the log file.

func RemoveLogFile

func RemoveLogFile(filepath string) error

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

func SetWatchLogFileSwitch(filePath string, watchSwitch bool)

SetWatchLogFileSwitch set swicth of watch log file

func WatchLogFile

func WatchLogFile(filePath string, topic string)

WatchLogFile watch the log and prouce one line to kafka topic per 200ms

Types

type HeatBeatPacket

type HeatBeatPacket struct {
	Action string `json:"action"`
	Id     string `json:"id"`
}

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 evnet 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"
)

type StepState

type StepState string

StepState is informatin aboout step evnet's state

const (
	Start  StepState = "start"
	Stop   StepState = "stop"
	Finish StepState = "finish"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL