// Copyright 2018 The go-github AUTHORS. All rights reserved.//// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.package githubimport ()// Event represents a GitHub event.typeEventstruct { Type *string`json:"type,omitempty"` Public *bool`json:"public,omitempty"` RawPayload *json.RawMessage`json:"payload,omitempty"` Repo *Repository`json:"repo,omitempty"` Actor *User`json:"actor,omitempty"` Org *Organization`json:"org,omitempty"` CreatedAt *Timestamp`json:"created_at,omitempty"` ID *string`json:"id,omitempty"`}func ( Event) () string {returnStringify()}// ParsePayload parses the event payload. For recognized event types,// a value of the corresponding struct type will be returned.func ( *Event) () (interface{}, error) {// It would be nice if e.Type were the snake_case name of the event, // but the existing interface uses the struct name instead. := EventForType(typeToMessageMapping[.GetType()])if := json.Unmarshal(.GetRawPayload(), &); != nil {returnnil, }return , nil}// Payload returns the parsed event payload. For recognized event types,// a value of the corresponding struct type will be returned.//// Deprecated: Use ParsePayload instead, which returns an error// rather than panics if JSON unmarshaling raw payload fails.func ( *Event) () ( interface{}) {varerror , = .ParsePayload()if != nil {panic() }return}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.