forked from vanus-labs/vanus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cf463f
commit c1d209c
Showing
3 changed files
with
106 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# How about contributing to Vanus | ||
|
||
TODO | ||
## Guides | ||
|
||
### CLA | ||
You must sign the Contributor License Agreement(TODO) in order to contribute. | ||
|
||
### TODO | ||
|
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,65 @@ | ||
// Copyright 2022 Linkall Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package primitive | ||
|
||
type URI string | ||
|
||
type Subscription struct { | ||
ID string `json:"id"` | ||
Source string `json:"source"` | ||
Types []string `json:"types"` | ||
Config map[string]string `json:"config"` | ||
Filters []map[string]string `json:"filters"` | ||
Sink URI `json:"sink"` | ||
Protocol string `json:"protocol"` | ||
ProtocolSettings map[string]string `json:"protocolsettings"` | ||
} | ||
|
||
type SinkSpec struct { | ||
Type string | ||
Name string // TODO use id or name? ID used in CloudEvents Specification | ||
Weight float32 | ||
Config map[string]interface{} | ||
} | ||
|
||
type DialectType string | ||
|
||
const ( | ||
ExactDialect = "exact" | ||
PrefixDialect = "prefix" | ||
SuffixDialect = "suffix" | ||
AllDialect = "all" | ||
AnyDialect = "any" | ||
NotDialect = "not" | ||
SQLDialect = "ce-sql" | ||
) | ||
|
||
type FilterSpec struct { | ||
Name string | ||
Exp interface{} | ||
ApplyTo []string | ||
Target TargetSpec | ||
} | ||
|
||
type SubscriptionSpec struct { | ||
EventBuses []string | ||
Sinks []SinkSpec | ||
Filters []FilterSpec | ||
} | ||
|
||
type TargetSpec struct { | ||
LBStrategy string | ||
Sinks []string | ||
} |
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,34 @@ | ||
// Copyright 2022 Linkall Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package primitive | ||
|
||
type TriggerState string | ||
|
||
const ( | ||
TriggerCreated = "created" | ||
TriggerPending = "pending" | ||
TriggerRunning = "running" | ||
TriggerSleep = "sleep" | ||
TriggerPaused = "paused" | ||
TriggerStopped = "stopped" | ||
TriggerDestroyed = "destroyed" | ||
) | ||
|
||
type Trigger struct { | ||
ID string `json:"id"` | ||
SubscriptionID string `json:"subscription_id"` | ||
State TriggerState `json:"state"` | ||
// other fields will be added in coding | ||
} |