Movatterモバイル変換


[0]ホーム

URL:


Notice  The highest tagged major version isv5.

plumbing

package
v4.7.0+incompatibleLatest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License:Apache-2.0Imports:11Imported by:9

Details

Repository

github.com/go-git/go-git

Links

Documentation

Overview

package plumbing implement the core interfaces and structs used by go-git

Index

Constants

This section is empty.

Variables

View Source
var (ErrObjectNotFound =errors.New("object not found")// ErrInvalidType is returned when an invalid object type is provided.ErrInvalidType =errors.New("invalid object type"))
View Source
var (ErrReferenceNotFound =errors.New("reference not found"))
View Source
var RefRevParseRules = []string{"refs/%s","refs/tags/%s","refs/heads/%s","refs/remotes/%s","refs/remotes/%s/HEAD",}

RefRevParseRules are a set of rules to parse references into short names.These are the same rules as used by git in shorten_unambiguous_ref.See:https://github.com/git/git/blob/e0aaa1b6532cfce93d87af9bc813fb2e7a7ce9d7/refs.c#L417

Functions

funcHashesSort

func HashesSort(a []Hash)

HashesSort sorts a slice of Hashes in increasing order.

Types

typeDeltaObject

type DeltaObject interface {EncodedObject// BaseHash returns the hash of the object used as base for this delta.BaseHash()Hash// ActualHash returns the hash of the object after applying the delta.ActualHash()Hash// Size returns the size of the object after applying the delta.ActualSize()int64}

DeltaObject is an EncodedObject representing a delta.

typeEncodedObject

type EncodedObject interface {Hash()HashType()ObjectTypeSetType(ObjectType)Size()int64SetSize(int64)Reader() (io.ReadCloser,error)Writer() (io.WriteCloser,error)}

Object is a generic representation of any git object

typeHash

type Hash [20]byte

Hash SHA1 hased content

var ZeroHashHash

ZeroHash is Hash with value zero

funcComputeHash

func ComputeHash(tObjectType, content []byte)Hash

ComputeHash compute the hash for a given ObjectType and content

funcNewHash

func NewHash(sstring)Hash

NewHash return a new Hash from a hexadecimal hash representation

func (Hash)IsZero

func (hHash) IsZero()bool

func (Hash)String

func (hHash) String()string

typeHashSlice

type HashSlice []Hash

HashSlice attaches the methods of sort.Interface to []Hash, sorting inincreasing order.

func (HashSlice)Len

func (pHashSlice) Len()int

func (HashSlice)Less

func (pHashSlice) Less(i, jint)bool

func (HashSlice)Swap

func (pHashSlice) Swap(i, jint)

typeHasher

type Hasher struct {hash.Hash}

funcNewHasher

func NewHasher(tObjectType, sizeint64)Hasher

func (Hasher)Sum

func (hHasher) Sum() (hashHash)

typeMemoryObject

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

MemoryObject on memory Object implementation

func (*MemoryObject)Close

func (o *MemoryObject) Close()error

Close releases any resources consumed by the object when it is acting as aObjectWriter.

func (*MemoryObject)Hash

func (o *MemoryObject) Hash()Hash

Hash returns the object Hash, the hash is calculated on-the-fly the firsttime it's called, in all subsequent calls the same Hash is returned evenif the type or the content have changed. The Hash is only generated if thesize of the content is exactly the object size.

func (*MemoryObject)Reader

func (o *MemoryObject) Reader() (io.ReadCloser,error)

Reader returns a ObjectReader used to read the object's content.

func (*MemoryObject)SetSize

func (o *MemoryObject) SetSize(sint64)

SetSize set the object size, a content of the given size should be writtenafterwards

func (*MemoryObject)SetType

func (o *MemoryObject) SetType(tObjectType)

SetType sets the ObjectType

func (*MemoryObject)Size

func (o *MemoryObject) Size()int64

Size return the size of the object

func (*MemoryObject)Type

func (o *MemoryObject) Type()ObjectType

Type return the ObjectType

func (*MemoryObject)Write

func (o *MemoryObject) Write(p []byte) (nint, errerror)

func (*MemoryObject)Writer

func (o *MemoryObject) Writer() (io.WriteCloser,error)

Writer returns a ObjectWriter used to write the object's content.

typeObjectType

type ObjectTypeint8

ObjectType internal object typeInteger values from 0 to 7 map to those exposed by git.AnyObject is used to represent any from 0 to 7.

const (InvalidObjectObjectType = 0CommitObjectObjectType = 1TreeObjectObjectType = 2BlobObjectObjectType = 3TagObjectObjectType = 4// 5 reserved for future expansionOFSDeltaObjectObjectType = 6REFDeltaObjectObjectType = 7AnyObjectObjectType = -127)

funcParseObjectType

func ParseObjectType(valuestring) (typObjectType, errerror)

ParseObjectType parses a string representation of ObjectType. It returns anerror on parse failure.

func (ObjectType)Bytes

func (tObjectType) Bytes() []byte

func (ObjectType)IsDelta

func (tObjectType) IsDelta()bool

IsDelta returns true for any ObjectTyoe that represents a delta (i.e.REFDeltaObject or OFSDeltaObject).

func (ObjectType)String

func (tObjectType) String()string

func (ObjectType)Valid

func (tObjectType) Valid()bool

Valid returns true if t is a valid ObjectType.

typePermanentError

type PermanentError struct {Errerror}

funcNewPermanentError

func NewPermanentError(errerror) *PermanentError

func (*PermanentError)Error

func (e *PermanentError) Error()string

typeReference

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

Reference is a representation of git reference

funcNewHashReference

func NewHashReference(nReferenceName, hHash) *Reference

NewHashReference creates a new HashReference reference

funcNewReferenceFromStrings

func NewReferenceFromStrings(name, targetstring) *Reference

NewReferenceFromStrings creates a reference from name and target as string,the resulting reference can be a SymbolicReference or a HashReference baseon the target provided

funcNewSymbolicReference

func NewSymbolicReference(n, targetReferenceName) *Reference

NewSymbolicReference creates a new SymbolicReference reference

func (*Reference)Hash

func (r *Reference) Hash()Hash

Hash return the hash of a hash reference

func (*Reference)Name

func (r *Reference) Name()ReferenceName

Name return the name of a reference

func (*Reference)String

func (r *Reference) String()string

func (*Reference)Strings

func (r *Reference) Strings() [2]string

Strings dump a reference as a [2]string

func (*Reference)Target

func (r *Reference) Target()ReferenceName

Target return the target of a symbolic reference

func (*Reference)Type

func (r *Reference) Type()ReferenceType

Type return the type of a reference

typeReferenceName

type ReferenceNamestring

ReferenceName reference name's

const (HEADReferenceName = "HEAD"MasterReferenceName = "refs/heads/master")

func (ReferenceName)IsBranch

func (rReferenceName) IsBranch()bool

IsBranch check if a reference is a branch

func (ReferenceName)IsNote

func (rReferenceName) IsNote()bool

IsNote check if a reference is a note

func (ReferenceName)IsRemote

func (rReferenceName) IsRemote()bool

IsRemote check if a reference is a remote

func (ReferenceName)IsTag

func (rReferenceName) IsTag()bool

IsTag check if a reference is a tag

func (ReferenceName)Short

func (rReferenceName) Short()string

Short returns the short name of a ReferenceName

func (ReferenceName)String

func (rReferenceName) String()string

typeReferenceType

type ReferenceTypeint8

ReferenceType reference type's

const (InvalidReferenceReferenceType = 0HashReferenceReferenceType = 1SymbolicReferenceReferenceType = 2)

func (ReferenceType)String

func (rReferenceType) String()string

typeRevision

type Revisionstring

Revision represents a git revisionto get more details about git revisionsplease check git manual page :https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html

func (Revision)String

func (rRevision) String()string

typeUnexpectedError

type UnexpectedError struct {Errerror}

funcNewUnexpectedError

func NewUnexpectedError(errerror) *UnexpectedError

func (*UnexpectedError)Error

func (e *UnexpectedError) Error()string

Source Files

View all Source files

Directories

PathSynopsis
format
config
Package config implements encoding and decoding of git config files.
Package config implements encoding and decoding of git config files.
gitignore
Package gitignore implements matching file system paths to gitignore patterns that can be automatically read from a git repository tree in the order of definition priorities.
Package gitignore implements matching file system paths to gitignore patterns that can be automatically read from a git repository tree in the order of definition priorities.
idxfile
Package idxfile implements encoding and decoding of packfile idx files.
Package idxfile implements encoding and decoding of packfile idx files.
index
Package index implements encoding and decoding of index format files.
Package index implements encoding and decoding of index format files.
objfile
Package objfile implements encoding and decoding of object files.
Package objfile implements encoding and decoding of object files.
packfile
Package packfile implements encoding and decoding of packfile format.
Package packfile implements encoding and decoding of packfile format.
pktline
Package pktline implements reading payloads form pkt-lines and encoding pkt-lines from payloads.
Package pktline implements reading payloads form pkt-lines and encoding pkt-lines from payloads.
Package object contains implementations of all Git objects and utility functions to work with them.
Package object contains implementations of all Git objects and utility functions to work with them.
protocol
packp/capability
Package capability defines the server and client capabilities.
Package capability defines the server and client capabilities.
packp/sideband
Package sideband implements a sideband mutiplex/demultiplexer
Package sideband implements a sideband mutiplex/demultiplexer
Package revlist provides support to access the ancestors of commits, in a similar way as the git-rev-list command.
Package revlist provides support to access the ancestors of commits, in a similar way as the git-rev-list command.
Package storer defines the interfaces to store objects, references, etc.
Package storer defines the interfaces to store objects, references, etc.
Package transport includes the implementation for different transport protocols.
Package transport includes the implementation for different transport protocols.
client
Package client contains helper function to deal with the different client protocols.
Package client contains helper function to deal with the different client protocols.
file
Package file implements the file transport protocol.
Package file implements the file transport protocol.
git
Package git implements the git transport protocol.
Package git implements the git transport protocol.
http
Package http implements the HTTP transport protocol.
Package http implements the HTTP transport protocol.
internal/common
Package common implements the git pack protocol with a pluggable transport.
Package common implements the git pack protocol with a pluggable transport.
server
Package server implements the git server protocol.
Package server implements the git server protocol.
ssh
Package ssh implements the SSH transport protocol.
Package ssh implements the SSH transport protocol.
test
Package test implements common test suite for different transport implementations.
Package test implements common test suite for different transport implementations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp