Skip to content

Commit db6d2af

Browse files
boolean change
1 parent 410b8f1 commit db6d2af

File tree

3 files changed

+56
-139
lines changed

3 files changed

+56
-139
lines changed

pkg/capabilities/capabilities.go

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ const (
4343
CapabilityTypeCombined CapabilityType = "combined"
4444
)
4545

46-
// MethodType is an enum for the type of method
47-
type MethodType string
48-
49-
// MethodType enum values.
50-
const (
51-
MethodAction MethodType = "executable"
52-
MethodTrigger MethodType = "trigger"
53-
)
54-
5546
// ActionSchedule is an enum for the type of method
5647
type ActionSchedule string
5748

@@ -549,27 +540,11 @@ func (c *RemoteExecutableConfig) ApplyDefaults() {
549540

550541
// CapabilityMethodConfig holds configuration for a capability method (action or trigger).
551542
type CapabilityMethodConfig struct {
552-
Type MethodType
543+
IsTrigger bool //default false
553544
ActionSchedule *ActionSchedule
554545
DeltaStage *time.Duration
555546
}
556547

557-
//example from Bolek
558-
//var CapabilityMethodConfigs = map[string]CapabilityMethodConfig{
559-
// "CallContract": {
560-
// Type: CapabilityTypeAction, // or CapabilityTypeExecutable if defined
561-
// Schedule: "all_at_once",
562-
// },
563-
// "LogTrigger": {
564-
// Type: CapabilityTypeTrigger,
565-
// },
566-
// "WriteReport": {
567-
// Type: CapabilityTypeAction, // or CapabilityTypeExecutable if defined
568-
// Schedule: "one_at_a_time",
569-
// DeltaStage: 10,
570-
// },
571-
//}
572-
573548
type CapabilityConfiguration struct {
574549
DefaultConfig *values.Map
575550
// RestrictedKeys is a list of keys that can't be provided by users in their

pkg/capabilities/pb/registry.pb.go

Lines changed: 52 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/capabilities/pb/registry.proto

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,13 @@ message RemoteExecutableConfig {
3232
google.protobuf.Duration registrationExpiry = 3;
3333
}
3434

35-
enum MethodType {
36-
EXECUTABLE = 0;
37-
TRIGGER = 1;
38-
}
39-
4035
enum ActionSchedule {
41-
OneAtATime = 0;
42-
AllAtOnce = 1;
36+
AllAtOnce = 0;
37+
OneAtATime = 1;
4338
}
4439

4540
message CapabilityMethodConfig {
46-
MethodType type = 1;
41+
bool isTrigger = 1; //defaut false (action), true (trigger)
4742
ActionSchedule schedule = 2;
4843
google.protobuf.Duration delta_stage = 3;
4944
}

0 commit comments

Comments
 (0)