identity

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCurrentIdentity = errors.New("no current identity: no identity was set")

Functions

func ApplyIdentity

func ApplyIdentity(ctx context.Context, i *configv2.Identity) error

func ApplyIdentityAsArgs added in v0.1.0

func ApplyIdentityAsArgs(ctx context.Context, i *configv2.Identity) ([]string, error)

func AutoMatchIdentity added in v0.1.0

func AutoMatchIdentity(ctx context.Context, i *configv2.Identity, info *gitinfo.GitInfo) (bool, error)

func CurrentIdentity

func CurrentIdentity(ctx context.Context, includeGlobal bool) (*configv2.Identity, error)

func EmptyConfig

func EmptyConfig() *configv2.Config

func FirstAutoMatchingIdentity added in v0.1.0

func FirstAutoMatchingIdentity(ctx context.Context, is []*configv2.Identity, info *gitinfo.GitInfo) (*configv2.Identity, error)

func GlobalIdentity

func GlobalIdentity(ctx context.Context) (*configv2.Identity, error)

func IdentitiesAsStrings

func IdentitiesAsStrings(is []*configv2.Identity) []string

func IdentityAsString

func IdentityAsString(i *configv2.Identity) string

func MarshalConfig added in v0.1.0

func MarshalConfig(cfg *configv2.Config) ([]byte, error)

func MarshalIdentity added in v0.1.0

func MarshalIdentity(i *configv2.Identity) ([]byte, error)

func ReadConfig

func ReadConfig(path string) (*configv2.Config, error)

func SortIdentities

func SortIdentities(is []*configv2.Identity)

func UnmarshalAndValidateConfig

func UnmarshalAndValidateConfig(cfgBytes []byte) (*configv2.Config, error)

func UnsetCurrentIdentity added in v0.1.0

func UnsetCurrentIdentity(ctx context.Context) error

func ValidateVersionEntity

func ValidateVersionEntity(ve VersionEntity) error

func WriteConfig

func WriteConfig(path string, cfg *configv2.Config) error

Types

type VersionEntity

type VersionEntity interface {
	GetVersion() string
}

func UnmarshalAndValidateVersionEntity

func UnmarshalAndValidateVersionEntity(p []byte) (VersionEntity, error)

Jump to

Keyboard shortcuts

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