Documentation ¶
Index ¶
Constants ¶
const ( EventCommit = "commit" EventSync = "sync" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶ added in v0.11.1
Commit represents the commit information in a sync event. We could use git.Commit, but that would lead to an import cycle, and may anyway represent coupling (of an internal API to serialised data) that we don't want.
func GetCommits ¶
func GetCommits(meta EventMetadata) []Commit
type CommitEventMetadata ¶ added in v0.11.1
type CommitEventMetadata struct {
Revision string `json:"revision,omitempty"`
}
CommitEventMetadata is the metadata for when new git commits are created
func (*CommitEventMetadata) Type ¶ added in v0.11.1
func (cem *CommitEventMetadata) Type() string
type Event ¶ added in v0.11.1
type Event struct { // Type is the type of event, usually "release" for now, but could be other // things later Type string `json:"type"` // Metadata is Event.Type-specific metadata. If an event has no metadata, // this will be nil. Metadata EventMetadata `json:"metadata,omitempty"` }
func (*Event) UnmarshalJSON ¶ added in v0.11.1
type EventMetadata ¶ added in v0.11.1
type EventMetadata interface {
Type() string
}
EventMetadata is a type safety trick used to make sure that Metadata field of Event is always a pointer, so that consumers can cast without being concerned about encountering a value type instead. It works by virtue of the fact that the method is only defined for pointer receivers; the actual method chosen is entirely arbitrary.
type ResourceError ¶ added in v0.11.1
func GetErrors ¶
func GetErrors(meta EventMetadata) []ResourceError
type SyncEventMetadata ¶ added in v0.11.1
type SyncEventMetadata struct { Commits []Commit `json:"commits,omitempty"` Errors []ResourceError `json:"errors,omitempty"` }
SyncEventMetadata is the metadata for when new a commit is synced to the cluster
func (*SyncEventMetadata) Type ¶ added in v0.11.1
func (cem *SyncEventMetadata) Type() string
type UnknownEventMetadata ¶ added in v0.11.1
type UnknownEventMetadata map[string]interface{}
func (UnknownEventMetadata) Type ¶ added in v0.11.1
func (uem UnknownEventMetadata) Type() string
Special exception from pointer receiver rule, as UnknownEventMetadata is a type alias for a map