-
Notifications
You must be signed in to change notification settings - Fork 98
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
Showing
33 changed files
with
1,277 additions
and
364 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
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,9 @@ | ||
package event | ||
|
||
// Service represents service for managing event types. | ||
type Service interface { | ||
CreateEventType(eventType *Type) (*Type, error) | ||
GetEventType(space string, name TypeName) (*Type, error) | ||
GetEventTypes(space string) (Types, error) | ||
DeleteEventType(space string, name TypeName) error | ||
} |
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,28 @@ | ||
package event | ||
|
||
import "go.uber.org/zap/zapcore" | ||
|
||
const ( | ||
// TypeHTTPRequest is a special type of event HTTP requests that are not CloudEvents. | ||
TypeHTTPRequest = TypeName("http.request") | ||
) | ||
|
||
// TypeName uniquely identifies an event type. | ||
type TypeName string | ||
|
||
// Type is a registered event type. | ||
type Type struct { | ||
Space string `json:"space" validate:"required,min=3,space"` | ||
Name TypeName `json:"name" validate:"required"` | ||
} | ||
|
||
// Types is an array of subscriptions. | ||
type Types []*Type | ||
|
||
// MarshalLogObject is a part of zapcore.ObjectMarshaler interface | ||
func (t Type) MarshalLogObject(enc zapcore.ObjectEncoder) error { | ||
enc.AddString("space", string(t.Space)) | ||
enc.AddString("name", string(t.Name)) | ||
|
||
return nil | ||
} |
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
Oops, something went wrong.