Documentation
¶
Index ¶
- Variables
- func AnyToString(value any) (string, bool)
- func AssignStruct(pa ActionsParams, st any) error
- func DiffJSON(src, target map[string]any) string
- func EnvMap() map[string]string
- func FlattenInterface(i any) map[string]string
- func MapToStructByTags(params map[string]any, dest any) error
- func MatchJSON(src, target map[string]any) bool
- func MergeMaps(base, over map[string]any) map[string]any
- func MergeStringMaps(base map[string]string, over map[string]any) map[string]string
- func RunActions(name string, args []string, with map[string]any, verbose bool) (map[string]any, error)
- func StrmapToAnymap(strmap map[string]string) map[string]any
- func StructToMapByTags(src any) (map[string]any, error)
- func TitleCase(st string, char string) string
- func UnflattenInterface(flatMap map[string]string) map[string]any
- type Actions
- type ActionsArgs
- type ActionsClient
- type ActionsParams
- type ActionsPlugin
- type ActionsServer
- type Config
- type Expr
- func (e *Expr) Eval(input string, env any) (any, error)
- func (e *Expr) EvalOrEvalTemplate(input string, env any) (string, error)
- func (e *Expr) EvalTemplate(input string, env any) (string, error)
- func (e *Expr) EvalTemplateMap(input map[string]any, env any) map[string]any
- func (e *Expr) Options(env any) []ex.Option
- type Job
- type JobContext
- type Probe
- type Repeat
- type Step
- type TestContext
- type ValidationError
- type Workflow
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BuiltinCmd = "builtin-actions" Handshake = plugin.HandshakeConfig{ProtocolVersion: 1, MagicCookieKey: "probe", MagicCookieValue: "actions"} PluginMap = map[string]plugin.Plugin{"actions": &ActionsPlugin{}} )
Functions ¶
func AnyToString ¶ added in v0.4.0
AnyToString attempts to convert any type to a string.
func AssignStruct ¶
func AssignStruct(pa ActionsParams, st any) error
func DiffJSON ¶ added in v0.4.0
DiffJSON compares two `map[string]any` objects strictly and collects differences.
func FlattenInterface ¶
func MapToStructByTags ¶
converting from a map[string]any to a struct
func MatchJSON ¶ added in v0.4.0
MatchJSON compares two `map[string]any` objects strictly. All fields in `src` and `target` must match, including structure and values.
func MergeMaps ¶ added in v0.4.0
MergeMaps merges two maps of type map[string]any. If keys conflict, the values from over override those in base. Nested maps are merged recursively.
func MergeStringMaps ¶
merge string maps
func RunActions ¶
func StructToMapByTags ¶
converting from a struct to a map[string]any
Types ¶
type ActionsArgs ¶
type ActionsArgs []string
type ActionsClient ¶
type ActionsClient struct {
// contains filtered or unexported fields
}
type ActionsParams ¶
type ActionsPlugin ¶
type ActionsPlugin struct { plugin.Plugin Impl Actions }
func (*ActionsPlugin) GRPCClient ¶
func (p *ActionsPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (any, error)
func (*ActionsPlugin) GRPCServer ¶
func (p *ActionsPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type ActionsServer ¶
type ActionsServer struct {
Impl Actions
}
func (*ActionsServer) Run ¶
func (m *ActionsServer) Run(ctx context.Context, req *pb.RunRequest) (*pb.RunResponse, error)
type Expr ¶ added in v0.2.0
type Expr struct{}
func (*Expr) EvalOrEvalTemplate ¶ added in v0.4.0
func (*Expr) EvalTemplate ¶ added in v0.2.0
func (*Expr) EvalTemplateMap ¶ added in v0.4.0
type Job ¶
type Job struct { Name string `yaml:"name",validate:"required"` Steps []Step `yaml:"steps",validate:"required"` Repeat *Repeat `yaml:"repeat"` Defaults any `yaml:"defaults"` // contains filtered or unexported fields }
func (*Job) Start ¶
func (j *Job) Start(ctx JobContext) bool
type JobContext ¶
type JobContext struct { Vars map[string]any `expr:"vars"` Logs []map[string]any `expr:"steps"` Config Failed bool }
func (*JobContext) SetFailed ¶ added in v0.2.0
func (j *JobContext) SetFailed()
type Probe ¶
type Probe struct { FilePath string // contains filtered or unexported fields }
func (*Probe) ExitStatus ¶ added in v0.2.0
type Step ¶
type Step struct { Name string `yaml:"name"` Uses string `yaml:"uses" validate:"required"` With map[string]any `yaml:"with"` Test string `yaml:"test"` Echo string `yaml:"echo"` Vars map[string]any `yaml:"vars"` // contains filtered or unexported fields }
func (Step) SetCtx ¶ added in v0.4.0
func (s Step) SetCtx(j JobContext, req, res map[string]any) TestContext
type TestContext ¶
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (*ValidationError) AddMessage ¶
func (e *ValidationError) AddMessage(s string)
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) HasError ¶
func (e *ValidationError) HasError() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.