common

package
v0.0.0-...-b193c95 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SYS_STDOUT         = os.Stdout
	Default_Err_Prefix = Prefix{Prefix: "error", Time: true}
	Time_Format        = time.Layout
)

Functions

func Inet_Aton

func Inet_Aton(src string) uint32

func Inet_NtoA

func Inet_NtoA(src uint32) net.IP

func LoadPlugin

func LoadPlugin(src *plugin.Plugin, opts ...*PluginOption) (count int)

load plugin,return the real load count

func Output

func Output(format string, args ...any)

func OutputWithPrefix

func OutputWithPrefix(pfx *Prefix, format string, args ...any)

func Pow

func Pow[T int | int16 | int32 | uint8 | uint16 | uint32](src T, step uint8) T

func ReadConfig

func ReadConfig(filepath string, v Cnf) error

func SetDebug

func SetDebug()

func SetRelease

func SetRelease(filepath string, isflush bool, mode os.FileMode) error

Types

type Cnf

type Cnf interface {
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
}

read config

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Clear

func (s *Error) Clear()

func (*Error) Error

func (s *Error) Error() string

func (*Error) Join

func (s *Error) Join(errs ...error)

type Outputer

type Outputer struct {
	Format string //format time string
	// contains filtered or unexported fields
}

the independent outputer 22 july 2023

func NewOutputer

func NewOutputer(out string, pre Prefix) *Outputer

func (*Outputer) Output

func (s *Outputer) Output(format string, args ...any)

func (*Outputer) OutputWithPrefix

func (s *Outputer) OutputWithPrefix(format string, args ...any)

type PluginOption

type PluginOption struct {
	Name   string
	Target any //store function
}

name is function's name which in your plugin go filem, target is tell plugin loador your function how to made here is an example var testone func(string)string var test_one PluginOption={"TestOne",testone}

type Prefix

type Prefix struct {
	Prefix string   `json:"prefix"`
	Time   bool     `json:"time"`
	Tags   []string `json:"tags"`
}

Jump to

Keyboard shortcuts

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