utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureStdout

func CaptureStdout(f func()) ([]string, error)

CaptureStdout 获取func执行的标准输出

func GetEnv

func GetEnv(key, fallback string) string

GetEnv 获取环境变量,不存在则使用默认值

func JSONMarshal

func JSONMarshal(v interface{}) ([]byte, error)

JSONMarshal 类似json.Marshal(), 但不转义特殊符号

func NewApmSpan

func NewApmSpan(ctx context.Context, name, spanType string) *apm.Span

NewApmSpan 根据context,在当前transaction中生成新的span记录

func NewUUID

func NewUUID() string

NewUUID 生成string类型的uuid

Types

type BaseMixin

type BaseMixin struct {
	mixin.Schema
}

BaseMixin model补充一些套路字段

func (BaseMixin) Fields

func (BaseMixin) Fields() []ent.Field

type BaseSchema

type BaseSchema struct {
	ent.Schema
}

BaseSchema 替换ent.Schema使用,包含套路字段

func (BaseSchema) Mixin

func (BaseSchema) Mixin() []ent.Mixin

Jump to

Keyboard shortcuts

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