dlog

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LevelField = Field{
	Name:    "level",
	Value:   "",
	Title:   "日志等级",
	Desc:    "",
	Type:    String,
	Input:   Gradient_select,
	Pattern: "",
	Option: []Option{
		{
			Value: "error",
			Title: "ERROR",
		},
		{
			Value: "warning",
			Title: "WARNING",
		},
		{
			Value: "info",
			Title: "INFO",
		},
		{
			Value: "debug",
			Title: "DEBUG",
		},
	},
}

Functions

This section is empty.

Types

type ConfigDriver

type ConfigDriver interface {
	config.ConfigDriver
	Title() string
	ConfigFields(ignoreNames ...string) []Field
}

type DriverInfo

type DriverInfo struct {
	Name   string  `json:"name"`
	Title  string  `json:"title"`
	Fields []Field `json:"fields"`
}

type DriverManager

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

func NewDriverManager

func NewDriverManager(drivers []ConfigDriver, ignoreField ...string) *DriverManager

func (*DriverManager) Get

func (m *DriverManager) Get(driver string) (ConfigDriver, bool)

func (*DriverManager) Infos

func (m *DriverManager) Infos() []DriverInfo

func (*DriverManager) Title

func (m *DriverManager) Title(name string) string

type Field

type Field struct {
	Name    string      `json:"name"`
	Title   string      `json:"title"`
	Value   interface{} `json:"value"`
	Desc    string      `json:"desc"`
	Type    FieldType   `json:"type"`
	Input   InputType   `json:"input"`
	Pattern string      `json:"pattern"`
	Option  []Option    `json:"option"`
	Fields  []SubField  `json:"fields"`
}

type FieldType

type FieldType string
const (
	String FieldType = "string"
	Number FieldType = "number"
	Array  FieldType = "array"
)

type FullFieldsDriver

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

func NewFullFieldsDriver

func NewFullFieldsDriver(fields []Field) *FullFieldsDriver

func (*FullFieldsDriver) ConfigFields

func (d *FullFieldsDriver) ConfigFields(ignoreNames ...string) []Field

type InputType

type InputType string
const (
	LineInput       InputType = "line"            // 单行文本
	MultiInput      InputType = "multi"           // 多行文本
	SelectInput     InputType = "select"          // 下拉框
	CheckboxInput   InputType = "checkbox"        // 多选
	RadioInput      InputType = "radio"           // 单选
	NumberInput     InputType = "number"          // 数值输入框
	Gradient_select InputType = "gradient_select" // 梯度选择
	TableInput      InputType = "table"           // 梯度选择
)

type Option

type Option struct {
	Value interface{} `json:"value"`
	Title string      `json:"title"`
}

type SubField

type SubField struct {
	Name    string `json:"name"`
	Title   string `json:"title"`
	Input   string `json:"input"`
	Desc    string `json:"desc"`
	Pattern string `json:"pattern"`
}

Jump to

Keyboard shortcuts

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