credentialhandler

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructRepositoryURL added in v0.2.0

func ConstructRepositoryURL(props *ArrayMap) (string, error)

func WriteProperties

func WriteProperties(props *ArrayMap, w io.Writer) error

Types

type ArrayMap added in v0.2.0

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

ArrayMap is a map of string to string, backed by a simple two dimensional array. Keys are preserved in insertion order.

It is only suited to small maps, as its lookup and set operations are O(n).

This is not to be used for performance, only for guaranteeing consistent iteration ordering.

func NewMap added in v0.2.0

func NewMap(cap int) *ArrayMap

func NewMapFromArray added in v0.2.0

func NewMapFromArray(a [][]string) *ArrayMap

func ReadProperties

func ReadProperties(r io.Reader) (*ArrayMap, error)

ReadProperties implements parsing a stream formatted as defined by the Git credential storage documentation. Multi-valued properties are not implemented -- not required for this system.

Note that the Reader may be fully consumed by this method.

See also: https://git-scm.com/docs/git-credential#IOFMT

func (*ArrayMap) AddAll added in v0.2.0

func (m *ArrayMap) AddAll(a [][]string)

func (*ArrayMap) Array added in v0.2.0

func (m *ArrayMap) Array() [][]string

Array returns a deep copy of the stored elements as a two-dimensional string array.

func (*ArrayMap) Get added in v0.2.0

func (m *ArrayMap) Get(k string) string

func (*ArrayMap) Iter added in v0.2.0

func (m *ArrayMap) Iter() iterator

func (*ArrayMap) Len added in v0.2.0

func (m *ArrayMap) Len() int

func (*ArrayMap) Lookup added in v0.2.0

func (m *ArrayMap) Lookup(k string) (string, bool)

func (*ArrayMap) Set added in v0.2.0

func (m *ArrayMap) Set(k, v string)

Jump to

Keyboard shortcuts

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