github

package
v0.0.0-...-79d858c Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RepositoryCreatedEventType = "repository"
	BranchCreatedEventType     = "branch"
	ZeroedSha                  = "0000000000000000000000000000000000000000"
)

Variables

View Source
var SpecVersion = "0.4.1"

Functions

func HandleTranslateGithubEvent

func HandleTranslateGithubEvent(event string, header http.Header) (string, error)

func Log

func Log() *zap.SugaredLogger

Log returns the zap logger If initialized

func Sync

func Sync(logger *zap.SugaredLogger) error

Types

type Change

type Change struct {
	Repository    string   `json:"repository"`
	Branch        string   `json:"branch"`
	Id            string   `json:"id"`
	Number        int      `json:"number"`
	Subject       string   `json:"subject"`
	Owner         Commiter `json:"commiter"`
	CommitMessage string   `json:"commitMessage"`
	CreatedOn     float64  `json:"createdOn"`
	Status        string   `json:"status"`
	Ref           string   `json:"ref"`
	Ref_type      string   `json:"ref_type"`
	Before        string   `json:"before"`
	After         string   `json:"after"`
}

type Commiter

type Commiter struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Username string `json:"username"`
}

type CommonFields

type CommonFields struct {
	Type      string  `json:"type"`
	CreatedAt float64 `json:"createdAt"`
	Url       string  `json:"repoURL,omitempty"`
}

type GithubEvent

type GithubEvent struct {
	Event string
	// contains filtered or unexported fields
}

func NewGithubEvent

func NewGithubEvent(event string, repoURL string) (pEvent *GithubEvent)

func (*GithubEvent) HandleBranchCreatedEvent

func (pEvent *GithubEvent) HandleBranchCreatedEvent() (string, error)

func (*GithubEvent) HandleRepoCreatedEvent

func (pEvent *GithubEvent) HandleRepoCreatedEvent() (string, error)

func (*GithubEvent) TranslateIntoCDEvent

func (pEvent *GithubEvent) TranslateIntoCDEvent() (string, error)

type PushChangeUpdated

type PushChangeUpdated struct {
	OldHead string `json:"oldHead"`
	NewHead string `json:"newHead"`
	CommonFields
	Change
}

func (*PushChangeUpdated) RepoUpdatedToCDEvent

func (changeUpdated *PushChangeUpdated) RepoUpdatedToCDEvent() (string, error)

type PushRepoCreated

type PushRepoCreated struct {
	Repository string `json:"repository"`
	HeadName   string `json:"headName"`
	CommonFields
}

func (*PushRepoCreated) RepositoryCreatedToCDEvent

func (repoCreated *PushRepoCreated) RepositoryCreatedToCDEvent() (string, error)

Jump to

Keyboard shortcuts

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