registry

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySecretToken  = weque.KeySecretToken
	KeyInsecureMode = weque.KeyInsecureMode
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(events chan<- *Webhook) http.HandlerFunc

func Verify

func Verify(r *http.Request) error

Types

type Actor

type Actor struct {
	Name string `json:"name"`
}

type Event

type Event struct {
	ID        string  `json:"id"`
	Timestamp string  `json:"timestamp"`
	Action    string  `json:"action"`
	Target    Target  `json:"target"`
	Request   Request `json:"request"`
	Actor     Actor   `json:"actor"`
}

func (*Event) Env

func (e *Event) Env() []string

type Request

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

type Source

type Source struct {
	Addr       string `json:"addr"`
	InstanceID string `json:"instanceID"`
}

type Target

type Target struct {
	MediaType  string `json:"mediaType"`
	Size       int    `json:"size"`
	Length     int    `json:"length"`
	Repository string `json:"repository"`
	Digest     string `json:"digest"`
	URL        string `json:"url"`
	Tag        string `json:"tag"`
}

type Webhook

type Webhook struct {
	Events []Event `json:"events"`
}
{
   "events": [
      {
         "id": "320678d8-ca14-430f-8bb6-4ca139cd83f7",
         "timestamp": "2016-03-09T14:44:26.402973972-08:00",
         "action": "pull",
         "target": {
            "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
            "size": 708,
            "digest": "sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf",
            "length": 708,
            "repository": "hello-world",
            "url": "http://192.168.100.227:5000/v2/hello-world/manifests/sha256:fea8895f450959fa676bcc1df0611ea93823a735a01205fd8622846041d0c7cf",
            "tag": "latest"
         },
         "request": {
            "id": "6df24a34-0959-4923-81ca-14f09767db19",
            "addr": "192.168.64.11:42961",
            "host": "192.168.100.227:5000",
            "method": "GET",
            "useragent": "curl/7.38.0"
         },
         "actor": {
            "name": "docker-hub"
	 },
         "source": {
            "addr": "xtal.local:5000",
            "instanceID": "a53db899-3b4b-4a62-a067-8dd013beaca4"
         }
      }
   ]
}

func Unmarshal

func Unmarshal(b []byte) (*Webhook, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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