support

package
v0.0.0-...-0ae16d5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Catch

func Catch(err error, hook func())

Catch global catch func

func LocalIP

func LocalIP() (ipv4 string, err error)

func ParseKind

func ParseKind(str string, kind reflect.Kind) interface{}

ParseKind

Types

type ClientContext

type ClientContext struct {
	Scanner  config.Scanner
	Property config.Exchange
	// contains filtered or unexported fields
}

func Client

func Client(client config.Exchange, hooks ClientHooks) ClientContext

func (ClientContext) Shutdown

func (ctx ClientContext) Shutdown()

func (ClientContext) Write

func (ctx ClientContext) Write(buffer []byte)

type ClientHooks

type ClientHooks struct {
	Started   func()
	Connected func(server net.Conn, ctx ClientContext)
	Ready     func(ctx ClientContext)
	Received  func([]byte)
}

type FuncParser

type FuncParser interface {
	// msg string in format as @func(...args)
	Parse(msg string) config.Func
}

FuncParser convert string to func

type GitLog

type GitLog struct {
	Message string
	// contains filtered or unexported fields
}

GitLog struct parsed

func ParseLine

func ParseLine(text string) GitLog

type GitLogDailyFormatter

type GitLogDailyFormatter struct{}

func (GitLogDailyFormatter) Format

func (GitLogDailyFormatter) Format(logs []GitLog) string

type GitLogParser

type GitLogParser struct{}

func (GitLogParser) Parse

func (GitLogParser) Parse(headFilePath string, start int64, end int64) []GitLog

type GitRelease

type GitRelease struct {
	Name    string            `json:"name"`
	TagName string            `json:"tag_name"`
	Assets  []GitReleaseAsset `json:"assets"`
}

type GitReleaseAsset

type GitReleaseAsset struct {
	Url  string `json:"browser_download_url"`
	Name string `json:"name"`
	Size int64  `json:"size"`
}

type LogParser

type LogParser interface {
	// Parse parse head file to GitLog
	Parse(headFilePath string, start int64, end int64) []GitLog
}

type ServerContext

type ServerContext struct {
	Scanner     config.Scanner
	Connections map[string]net.Conn
	Property    config.Exchange
	// contains filtered or unexported fields
}

func Bootstrap

func Bootstrap(server config.Exchange, hooks ServerHooks) ServerContext

func (ServerContext) Shutdown

func (ctx ServerContext) Shutdown()

func (ServerContext) Write

func (ctx ServerContext) Write(buffer []byte)

type ServerHooks

type ServerHooks struct {
	Started func(ctx ServerContext)
	// client connection is successful
	Accepted func(client net.Conn, ctx ServerContext)
	Received func(buffer []byte, ctx ServerContext, conn net.Conn)
	Ready    func(ctx ServerContext)
	Deleted  func(client net.Conn, ctx ServerContext)
}

type SmartFuncParser

type SmartFuncParser struct{}

func (SmartFuncParser) Parse

func (SmartFuncParser) Parse(msg string) (config.Func, error)

Jump to

Keyboard shortcuts

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