notifications

package
v0.0.0-...-930013b Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestMediaType = "application/vnd.docker.distribution.manifest.v1+json"
	BlobMediaType     = "application/vnd.docker.distribution.manifest.v1+json" // TODO: to be confirm with reciever
	DefaultMedisType  = "application/octet-stream"
	EventsMediaType   = "application/vnd.docker.distribution.events.v1+json"
)
View Source
const (
	EventActionPull = "pull"
	EventActionPush = "push"
)

Variables

View Source
var (
	ErrSinkClosed = fmt.Errorf("sink: closed")
)

Functions

This section is empty.

Types

type ActorRecord

type ActorRecord struct {
	Name string `json:"name,omitempty"`
}

type Descriptor

type Descriptor struct {
	MediaType string `json:"mediaType,omitempty"`
	Size      int64  `json:"size,omitempty"`
	Digest    string `json:"digest,omitempty"`
}

type Endpoint

type Endpoint struct {
	Sink
	EndpointDesc
}

type EndpointDesc

type EndpointDesc struct {
	Name      string
	URL       string
	Headers   http.Header
	Timeout   time.Duration
	Threshold int
	Backoff   time.Duration
	EventDB   string
	Disabled  bool
}

type Envelope

type Envelope struct {
	Events []Event `json:"events,omitempty"`
}

type Error

type Error struct {
	Err        error
	StatusCode int
}

type Event

type Event struct {
	ID        string        `json:"id,omitempty"`
	Timestamp time.Time     `json:"timestamp,omitempty"`
	Action    string        `json:"action,omitempty"`
	Target    TargetCtx     `json:"target,omitempty"`
	Req       RequestRecord `json:"request,omitempty"`
	Actor     ActorRecord   `json:"actor,omitempty"`
	Source    SourceRecord  `json:"source,omitempty"`
}

type FSLayer

type FSLayer struct {
	BlobSum string `json:"blobSum"`
}

type History

type History struct {
	V1Compatibility string `json:"v1Compatibility"`
}

type Manifest

type Manifest struct {
	SchemaVersion int       `json:"schemaVersion"`
	Name          string    `json:"name"`
	Tag           string    `json:"tag"`
	Architecture  string    `json:"architecture"`
	FSLayers      []FSLayer `json:"fsLayers"`
	History       []History `json:"history"`
}

type RequestRecord

type RequestRecord struct {
	ID        string `json:"id"`
	Addr      string `json:"addr,omitempty"`
	Host      string `json:"host,omitempty"`
	Method    string `json:"method"`
	UserAgent string `json:"useragent"`
}

type SignedManifest

type SignedManifest struct {
	Manifest
	Raw []byte `json:"-"`
}

type Sink

type Sink interface {
	Write(events ...Event) Error
	Close() error
}

type SourceRecord

type SourceRecord struct {
	Addr       string `json:"addr,omitempty"`
	InstanceID string `json:"instanceID,omitempty"`
}

type TargetCtx

type TargetCtx struct {
	Descriptor
	Length     int64     `json:"length,omitempty"`
	Repository string    `json:"repository,omitempty"`
	Tag        string    `json:"tag,omitempty"`
	URL        string    `json:"url,omitempty"`
	FSLayers   []FSLayer `json:"fsLayers,omitempty"`
}

Jump to

Keyboard shortcuts

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