log

package
v0.0.0-...-1806480 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var (
	// Output is used to collect log information.
	Output filebuffer.FileBuffer
)

Functions

func CreateFileBuffer

func CreateFileBuffer(eventID api.EventID) error

CreateFileBuffer func that create a file buffer for storage log

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, ch chan interface{})

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

type StepState

type StepState string

StepState is information about step event'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