Skip to content

Commit

Permalink
Merge pull request #36 from chainguard-dev/create-pull-request/patch
Browse files Browse the repository at this point in the history
Export mono/sdk: refs/heads/main
  • Loading branch information
cmdpdx authored May 9, 2024
2 parents a953aa7 + 47a9cc5 commit 1c56300
Show file tree
Hide file tree
Showing 4 changed files with 599 additions and 568 deletions.
6 changes: 6 additions & 0 deletions events/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ const (

// PushedEventType is the cloudevents event type for registry pushes
PushedEventType = "dev.chainguard.registry.push.v1"

// RepoCreatedEventType is the cloudevents event type for registry repo created
RepoCreatedEventType = "dev.chainguard.api.platform.registry.repo.created.v1"

// RepoUpdatedEventType is the cloudevents event type for registry repo updated
RepoUpdatedEventType = "dev.chainguard.api.platform.registry.repo.updated.v1"
)

// PullEvent describes an item being pulled from the registry.
Expand Down
21 changes: 21 additions & 0 deletions proto/platform/registry/v1/registry.platform.event.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright 2024 Chainguard, Inc.
SPDX-License-Identifier: Apache-2.0
*/

package v1

// CloudEventsExtension implements chainguard.dev/sdk/events/Extendable.CloudEventsExtension
func (x *Repo) CloudEventsExtension(key string) (string, bool) {
switch key {
case "group":
return x.GetId(), true
default:
return "", false
}
}

// CloudEventsSubject implements chainguard.dev/sdk/events/Eventable.CloudEventsSubject.
func (x *Repo) CloudEventsSubject() string {
return x.GetId()
}
Loading

0 comments on commit 1c56300

Please sign in to comment.