gitlab

package
v0.0.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Logger                zerolog.Logger
	PlatformTokenProvider providers.PlatformTokenProvider
	AuthProvider          providers.RepositoryAuth
	UUIDGenerator         providers.UUIDGenerator
}

Dependencies defines the dependencies for the plugin provider.

type Gitlab

type Gitlab struct {
	Dependencies
	// contains filtered or unexported fields
}

Gitlab is a gitlab based platform implementation.

func NewGitlabPlatformProvider

func NewGitlabPlatformProvider(deps Dependencies) *Gitlab

NewGitlabPlatformProvider creates a new hook platform provider for Gitlab.

func (*Gitlab) CreateHook

func (g *Gitlab) CreateHook(ctx context.Context, repo *models.Repository) error

CreateHook can create a hook for the Gitlab platform.

func (*Gitlab) GetEventID

func (g *Gitlab) GetEventID(ctx context.Context, r *http.Request) (string, error)

GetEventID Based on the platform, retrieve the ID of the event.

func (*Gitlab) GetEventType added in v0.0.11

func (g *Gitlab) GetEventType(ctx context.Context, r *http.Request) (string, error)

GetEventType Based on the platform, retrieve the Type of the event.

func (*Gitlab) ValidateRequest

func (g *Gitlab) ValidateRequest(ctx context.Context, req *http.Request, repoID int) error

ValidateRequest will take a hook and verify it being a valid hook request according to Gitlab's rules.

Jump to

Keyboard shortcuts

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