Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeCommit(block blocks.Block) (format.Node, error)
- type Commit
- func (c *Commit) Cid() cid.Cid
- func (c *Commit) Copy() format.Node
- func (c *Commit) Hash() multihash.Multihash
- func (c *Commit) Links() []*format.Link
- func (c *Commit) Loggable() map[string]interface{}
- func (c *Commit) RawData() []byte
- func (c *Commit) Resolve(path []string) (interface{}, []string, error)
- func (c *Commit) ResolveLink(path []string) (*format.Link, []string, error)
- func (c *Commit) Size() (uint64, error)
- func (c *Commit) Stat() (*format.NodeStat, error)
- func (c *Commit) String() string
- func (c *Commit) Tree(path string, depth int) []string
- type Parents
Constants ¶
View Source
const (
// CommitCodec is the multicodec id for commits.
CommitCodec = 0x300001
)
Variables ¶
View Source
var ( // ErrNoLink is returned when an invalid path is resolved. ErrNoLink = errors.New("no such link") // ErrZeroLenPath is returned when a path of len zero is resolved. ErrZeroLenPath = errors.New("zero length path") )
Functions ¶
func DecodeCommit ¶
func DecodeCommit(block blocks.Block) (format.Node, error)
DecodeCommit is a block decoder for raw IPLD nodes.
Types ¶
type Commit ¶
type Commit struct { // Date is the timestamp of when the commit was created. Date time.Time `json:"date"` // Message is a description of the changes. Message string `json:"message"` // Parents contains the CIDs of parent commits. Parents Parents `json:"parents"` // PeerID is the hash of the author's public key. PeerID peer.ID `json:"peer_id"` // WorkTree is the current state of the repo files. WorkTree cid.Cid `json:"tree"` // contains filtered or unexported fields }
Commit contains info about changes to a repo.
func (*Commit) Copy ¶
func (c *Commit) Copy() format.Node
Copy will go away. It is here to comply with the Node interface.
func (*Commit) Hash ¶ added in v0.0.4
func (c *Commit) Hash() multihash.Multihash
Hash returns the multihash of the block.
func (*Commit) Links ¶
func (c *Commit) Links() []*format.Link
Links is a helper function that returns all links within this object
func (*Commit) Resolve ¶
Resolve resolves a path through this node, stopping at any link boundary and returning the object found as well as the remaining path to traverse
func (*Commit) ResolveLink ¶
ResolveLink is a helper function that calls resolve and asserts the output is a link
Click to show internal directories.
Click to hide internal directories.