events: github.com/shurcooL/events/event Index | Files

package event

import "github.com/shurcooL/events/event"

Package event defines event types.

Index

Package Files

event.go types.go

type Change Uses

type Change struct {
    Action        string // "opened", "closed", "merged", "reopened".
    ChangeTitle   string
    ChangeHTMLURL string
}

Change is a change event.

type ChangeComment Uses

type ChangeComment struct {
    ChangeTitle    string
    ChangeState    state.Change
    CommentBody    string
    CommentHTMLURL string
}

ChangeComment is a change comment event.

type Commit Uses

type Commit struct {
    SHA             string
    Message         string
    AuthorAvatarURL string
    HTMLURL         string // Optional.
}

Commit describes a commit in a CommitComment or Push event.

type CommitComment Uses

type CommitComment struct {
    Commit      Commit
    CommentBody string
}

CommitComment is a commit comment event.

type Create Uses

type Create struct {
    Type        string // "repository", "package", "branch", "tag".
    Name        string // Only for "branch", "tag" types.
    Description string // Only for "repository", "package" types.
}

Create is a create event.

type Delete Uses

type Delete struct {
    Type string // "branch", "tag".
    Name string
}

Delete is a delete event.

type Event Uses

type Event struct {
    Time      time.Time
    Actor     users.User // UserSpec and Login fields populated.
    Container string     // URL of container without schema. E.g., "github.com/user/repo".

    // Payload specifies the event type. It's one of:
    // Issue, Change, IssueComment, ChangeComment, CommitComment,
    // Push, Star, Create, Fork, Delete, Wiki.
    Payload interface{}
}

Event represents an event.

func (Event) MarshalJSON Uses

func (e Event) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Event) UnmarshalJSON Uses

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

UnmarshalJSON implements the json.Unmarshaler interface.

type Fork Uses

type Fork struct {
    Container string // URL of forkee container without schema. E.g., "github.com/user/repo".
}

Fork is a fork event.

type Issue Uses

type Issue struct {
    Action       string // "opened", "closed", "reopened".
    IssueTitle   string
    IssueHTMLURL string
}

Issue is an issue event.

type IssueComment Uses

type IssueComment struct {
    IssueTitle     string
    IssueState     state.Issue
    CommentBody    string
    CommentHTMLURL string
}

IssueComment is an issue comment event.

type Page Uses

type Page struct {
    Action         string // "created", "edited".
    SHA            string
    Title          string
    HTMLURL        string
    CompareHTMLURL string
}

Page describes a page action in a Wiki event.

type Push Uses

type Push struct {
    Branch  string   // Name of branch pushed to. E.g., "master".
    Head    string   // SHA of the most recent commit after the push.
    Before  string   // SHA of the most recent commit before the push.
    Commits []Commit // Ordered from earliest to most recent (head).

    HeadHTMLURL   string // Optional.
    BeforeHTMLURL string // Optional.
}

Push is a push event.

type Star Uses

type Star struct{}

Star is a star event.

type Wiki Uses

type Wiki struct {
    Pages []Page // Wiki pages that are affected.
}

Wiki is a wiki event. It happens when an actor updates a wiki.

Package event imports 5 packages (graph) and is imported by 9 packages. Updated 2018-10-16. Refresh now. Tools for package owners.