ci

package
v0.0.0-...-7a6e8ff Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: GPL-3.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CIProvidersFile []byte

this directive is necessary to load file in this variable; it will also include the file automatically during build ref about embed directive: https://pkg.go.dev/embed@master

Functions

func Bootstrap

func Bootstrap(customUserIdentifierKey string)

populates session information in CISessionConfig Session values do not populate automatically with an intent of required custom loaders that users might want to load something before bootstrapping

func IsCIEnvironment

func IsCIEnvironment() bool

Types

type CI

type CI struct {
	CIIdentifierEnvKeys     []string
	Providers               *[]Provider
	CustomUserIdentifierKey string
}
var CIConfig *CI = &CI{}

Global CI Configuration

type CISession

type CISession struct {
	IsCI           bool
	UserIdentifier string
	Provider       *Provider
}
var CISessionConfig *CISession = &CISession{}

Session CI Configuration

type Identifier

type Identifier struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Provider

type Provider struct {
	// name of the ci provider
	Name string `json:"name"`

	// defines the distinct env key and its value that can be
	// used to identify the CI provider in the ci environment
	// all identifiers need to match in case of multiples
	Identifiers []Identifier `json:"identifiers"`

	// defines the env keys that can be used to
	// identify the user in the ci environment
	UserKeys []string `json:"keys"`
}

func IdentifyCIProvider

func IdentifyCIProvider() *Provider

func (*Provider) GetUserIdentifierFromCIEnvironment

func (provider *Provider) GetUserIdentifierFromCIEnvironment() string

Jump to

Keyboard shortcuts

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