flux

package
v0.11.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCommit = "commit"
	EventSync   = "sync"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit added in v0.11.1

type Commit struct {
	Revision string `json:"revision"`
	Message  string `json:"message"`
}

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) String added in v0.11.1

func (e Event) String() string

func (*Event) UnmarshalJSON added in v0.11.1

func (e *Event) UnmarshalJSON(in []byte) error

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

type ResourceError struct {
	// ID    ID
	Path  string
	Error string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL