webhook

package
v0.0.0-...-f834c1b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadMappingFromFile

func LoadMappingFromFile(path string, fileReader FileReader) (map[string]string, error)

Load the prefix to target url from a file

Types

type ConfigWebhookURLLoader

type ConfigWebhookURLLoader struct {
	// contains filtered or unexported fields
}

func NewConfigWebhookURLLoader

func NewConfigWebhookURLLoader(mapping map[string]string) ConfigWebhookURLLoader

func (ConfigWebhookURLLoader) Load

func (c ConfigWebhookURLLoader) Load(repositoryUrl string) string
Load implements WebhookURLLoader.

Find the longest prefix match of `repositoryUrl“ and the keys of `mapping`, and return the value of that key.

type FileReader

type FileReader func(name string) ([]byte, error)

type WebhookURLLoader

type WebhookURLLoader interface {
	Load(repositoryUrl string) string
}

Jump to

Keyboard shortcuts

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