github

package
v0.23.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

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

Usage:

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

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

func NewTest

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

NewTest returns a SCM 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.

Types

type ClientOpt

type ClientOpt func(*client) error

ClientOpt represents a configuration option to initialize the scm client for GitHub.

func WithAddress

func WithAddress(address string) ClientOpt

WithAddress sets the GitHub address in the scm client for GitHub.

func WithClientID

func WithClientID(id string) ClientOpt

WithClientID sets the OAuth client ID in the scm client for GitHub.

func WithClientSecret

func WithClientSecret(secret string) ClientOpt

WithClientSecret sets the OAuth client secret in the scm client for GitHub.

func WithScopes

func WithScopes(scopes []string) ClientOpt

WithScopes sets the OAuth scopes in the scm client for GitHub.

func WithServerAddress

func WithServerAddress(address string) ClientOpt

WithServerAddress sets the Vela server address in the scm client for GitHub.

func WithServerWebhookAddress

func WithServerWebhookAddress(address string) ClientOpt

WithServerWebhookAddress sets the Vela server webhook address in the scm client for GitHub.

func WithStatusContext

func WithStatusContext(context string) ClientOpt

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

func WithWebUIAddress

func WithWebUIAddress(address string) ClientOpt

WithWebUIAddress sets the Vela web UI address in the scm client for GitHub.

Jump to

Keyboard shortcuts

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