-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from yandex/dev
v0.5.19
- Loading branch information
Showing
33 changed files
with
3,306 additions
and
1,111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package scenario | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/golang/protobuf/proto" | ||
) | ||
|
||
type SourceStorage interface { | ||
Variables() map[string]any | ||
} | ||
|
||
type Scenario struct { | ||
id uint64 | ||
Calls []Call | ||
Name string | ||
MinWaitingTime time.Duration | ||
VariableStorage SourceStorage | ||
} | ||
|
||
func (a *Scenario) SetID(id uint64) { | ||
a.id = id | ||
} | ||
|
||
type Call struct { | ||
Name string | ||
Preprocessors []Preprocessor | ||
Postprocessors []Postprocessor | ||
|
||
Tag string `json:"tag"` | ||
Call string `json:"call"` | ||
Metadata map[string]string `json:"metadata"` | ||
Payload []byte `json:"payload"` | ||
|
||
Sleep time.Duration `json:"sleep"` | ||
} | ||
|
||
type Postprocessor interface { | ||
Process(out proto.Message, code int) (map[string]any, error) | ||
} | ||
|
||
type Preprocessor interface { | ||
Process(call *Call, templateVars map[string]any) (newVars map[string]any, err error) | ||
} |
Oops, something went wrong.