worker

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoFormatRedis

func AutoFormatRedis(act *recording.CallOutbound)

func ExitHook

func ExitHook()

func FetchSessions

func FetchSessions(ctx context.Context, sessionId string, project string) []*replaying.Session

func GenTraceID

func GenTraceID() string

GenTraceID 生成traceID

func UniformCurlMulti

func UniformCurlMulti(outbound []*recording.CallOutbound) []*recording.CallOutbound

Types

type Experiment

type Experiment struct {
	Groups []Group `json:"groups"`
}

type Group

type Group struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Rule        Rule   `json:"rule"`
}

type MockData

type MockData struct {
	Toggle Toggle `json:"toggle"`
}

type Record

type Record struct {
	Session esmodel.Session `json:"data"`
}

type Replayer

type Replayer struct {
	BasePort int // the base port number of the outbound servers
	OBSIdx   int // stands for the index of the outbound servers

	Language string // language of module
	Protocol string // protocol of module

	ReplayAddr string

	ReplayedSession *replayed.Session // replayed session
}

func (*Replayer) ReplaySession

func (r *Replayer) ReplaySession(ctx context.Context, session *replaying.Session, project string) error

func (*Replayer) ReplaySessionDoreplay

func (r *Replayer) ReplaySessionDoreplay(ctx context.Context, session *replaying.Session, traceID string, project string) (int, error)

func (*Replayer) ReplaySessionPreHandle

func (r *Replayer) ReplaySessionPreHandle(ctx context.Context, session *replaying.Session) (int, error)

type Rule

type Rule struct {
	Subject string     `json:"subject"`
	Verb    string     `json:"verb"`
	Objects [][]string `json:"objects"`
}

type Toggle

type Toggle struct {
	Namespace      string     `json:"namespace"`
	Name           string     `json:"name"`
	Version        int        `json:"version"`
	LastModifyTime int64      `json:"last_modify_time"`
	LogRate        int        `json:"log_rate"`
	Rule           Rule       `json:"rule"`
	Experiment     Experiment `json:"experiment"`
	PublishTo      []string   `json:"publish_to"`
	SchemaVersion  string     `json:"schema_version"`
}

type Transformer

type Transformer struct {
}

TODO: 处理redis数据存map

func (*Transformer) BuildSessions

func (t *Transformer) BuildSessions(sessions []esmodel.Session) ([]*replaying.Session, error)

Jump to

Keyboard shortcuts

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