logic

package
v1.2.0-rc Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyCollectorLogID = "logID"
	CtxKeyLogger         = "logger"
)
View Source
const (
	ResultSuccess = "success"
	ResultFailed  = "failed"
)
View Source
const CookieJar = "cookieJar"
View Source
const (
	MetaKeyResult = "result"
)

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, task *spec.PipelineTask)

Do do api test.

attention:

push log to collector
save metadata

Types

type APIAssert

type APIAssert struct {
	Arg      string      `json:"arg"`
	Operator string      `json:"operator"`
	Value    interface{} `json:"value"`
}

type APIHeader

type APIHeader struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
	Desc  string      `json:"desc"`
}

type APIParam

type APIParam struct {
	Key   string      `json:"key"`
	Value interface{} `json:"value"`
	Desc  string      `json:"desc"`
}

type CollectorHook

type CollectorHook struct{}

func (*CollectorHook) Fire

func (c *CollectorHook) Fire(entry *logrus.Entry) error

func (*CollectorHook) Levels

func (c *CollectorHook) Levels() []logrus.Level

type EnvConfig

type EnvConfig struct {
	Name         string                        `env:"ACTION_NAME"`
	URL          string                        `env:"ACTION_URL" required:"true"`
	Method       string                        `env:"ACTION_METHOD" required:"true"`
	Params       []APIParam                    `env:"ACTION_PARAMS"`
	Headers      []APIHeader                   `env:"ACTION_HEADERS"`
	Body         apistructs.APIBody            `env:"ACTION_BODY"`
	OutParams    []apistructs.APIOutParam      `env:"ACTION_OUT_PARAMS"`
	Asserts      []APIAssert                   `env:"ACTION_ASSERTS"`
	GlobalConfig *apistructs.AutoTestAPIConfig `env:"AUTOTEST_API_GLOBAL_CONFIG"`

	MetaFile string `env:"METAFILE"`
}

type KVs

type KVs []kv

type Meta

type Meta struct {
	Result          string
	AssertResult    bool
	AssertDetail    string
	Req             *apistructs.APIRequestInfo
	Resp            *apistructs.APIResp
	OutParamsDefine []apistructs.APIOutParam
	CookieJar       cookiejar.Cookies
	OutParamsResult map[string]interface{}
}

func NewMeta

func NewMeta() *Meta

Jump to

Keyboard shortcuts

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