sha

package
v1.0.4-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Nil  = Must("0000000000000000000000000000000000000000")
	None = SHA{}

	// EmptyTree is the SHA of an empty tree.
	EmptyTree = Must("4b825dc642cb6eb9a060e54bf8d69288fbee4904")
)

Functions

This section is empty.

Types

type SHA

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

SHA represents a git sha.

func Must

func Must(value string) SHA

Must returns sha if there is an error it will panic.

func New

func New(value string) (SHA, error)

New creates and validates SHA from the value.

func NewOrEmpty

func NewOrEmpty(value string) (SHA, error)

NewOrEmpty returns None if value is empty otherwise it will try to create and validate new SHA object.

func (SHA) Equal

func (s SHA) Equal(val SHA) bool

Equal returns true if val has the same SHA.

func (*SHA) GobDecode

func (s *SHA) GobDecode(v []byte) error

func (SHA) GobEncode

func (s SHA) GobEncode() ([]byte, error)

func (SHA) IsEmpty

func (s SHA) IsEmpty() bool

IsEmpty returns whether this SHA is empty string.

func (SHA) IsNil

func (s SHA) IsNil() bool

IsNil returns whether this SHA is all zeroes.

func (SHA) JSONSchema

func (s SHA) JSONSchema() (jsonschema.Schema, error)

func (SHA) MarshalJSON

func (s SHA) MarshalJSON() ([]byte, error)

func (SHA) String

func (s SHA) String() string

String returns string representation of the SHA.

func (*SHA) UnmarshalJSON

func (s *SHA) UnmarshalJSON(content []byte) error

Jump to

Keyboard shortcuts

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