github

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package github provides the ability for Vela to integrate with GitHub or GitHub Enterprise as a source provider.

Usage:

import "github.com/go-vela/server/source/github"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...ClientOpt) (*client, error)

New returns a Source implementation that integrates with a GitHub or a GitHub Enterprise instance.

nolint: revive // ignore returning unexported client

func NewTest

func NewTest(urls ...string) (*client, error)

NewTest returns a Source implementation that integrates with the provided mock server. Only the url from the mock server is required.

This function is intended for running tests only.

nolint: revive // ignore returning unexported client

Types

type ClientOpt added in v0.8.0

type ClientOpt func(*client) error

ClientOpt represents a configuration option to initialize the source client.

func WithAddress added in v0.8.0

func WithAddress(address string) ClientOpt

WithAddress sets the GitHub address in the source client.

func WithClientID added in v0.8.0

func WithClientID(id string) ClientOpt

WithClientID sets the GitHub OAuth client ID in the source client.

func WithClientSecret added in v0.8.0

func WithClientSecret(secret string) ClientOpt

WithClientSecret sets the GitHub OAuth client secret in the source client.

func WithScopes added in v0.8.4

func WithScopes(scopes []string) ClientOpt

WithScopes sets the GitHub OAuth scopes in the source client.

func WithServerAddress added in v0.8.0

func WithServerAddress(address string) ClientOpt

WithServerAddress sets the Vela server address in the source client.

func WithServerWebhookAddress added in v0.10.0

func WithServerWebhookAddress(address string) ClientOpt

WithServerWebhookAddress sets the Vela server webhook address in the source client.

func WithStatusContext added in v0.8.0

func WithStatusContext(context string) ClientOpt

WithStatusContext sets the GitHub context for commit statuses in the source client.

func WithWebUIAddress added in v0.8.0

func WithWebUIAddress(address string) ClientOpt

WithWebUIAddress sets the Vela web UI address in the source client.

Jump to

Keyboard shortcuts

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