Commit 020018ca authored by Hector Sanjuan's avatar Hector Sanjuan Committed by Hector Sanjuan

Initial commit

parents
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib
# Test binary, build with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
0.0.1: QmdQQhe1a4FLTp14Tm3GyJpbn6JZrawtEvD8FskzxHqwVZ
language: go
go:
- tip
install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/mattn/goveralls
- make all
script:
- make test
MIT License
Copyright (c) 2018 IPFS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
all: deps
gx:
go get github.com/whyrusleeping/gx
go get github.com/whyrusleeping/gx-go
deps: gx
gx --verbose install --global
gx-go rewrite
test: deps
go test -v -covermode count -coverprofile=coverage.out .
rw:
gx-go rewrite
rwundo:
gx-go rewrite --undo
publish: rwundo
gx publish
.PHONY: all gx deps test rw rwundo publish
# go-ipfs-posinfo
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![GoDoc](https://godoc.org/github.com/ipfs/go-ipfs-posinfo?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-posinfo)
[![Build Status](https://travis-ci.org/ipfs/go-ipfs-posinfo.svg?branch=master)](https://travis-ci.org/ipfs/go-ipfs-posinfo)
> Posinfo wraps offset information for ipfs filestore nodes
## Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#license)
## Install
```
go get github.com/ipfs/go-ipfs-posinfo
```
## Usage
See the [GoDoc documentation](https://godoc.org/github.com/ipfs/go-ipfs-posinfo)
## Contribute
PRs accepted.
Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
## License
MIT © Protocol Labs, Inc.
{
"author": "hector",
"bugs": {
"url": "https://github.com/ipfs/go-ipfs-posinfo"
},
"gx": {
"dvcsimport": "github.com/ipfs/go-ipfs-posinfo"
},
"gxDependencies": [
{
"author": "whyrusleeping",
"hash": "Qme5bWv7wtjUNGsK2BNGVUFPKiuxWrsqrtvYwCLRw8YFES",
"name": "go-ipld-format",
"version": "0.5.3"
}
],
"gxVersion": "0.12.1",
"language": "go",
"license": "MIT",
"name": "go-ipfs-posinfo",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.0.1"
}
// Package posinfo wraps offset information used by ipfs filestore nodes
package posinfo
import (
"os"
ipld "github.com/ipfs/go-ipld-format"
)
// PosInfo stores information about the file offset, its path and
// stat.
type PosInfo struct {
Offset uint64
FullPath string
Stat os.FileInfo // can be nil
}
// FilestoreNode is an ipld.Node which arries PosInfo with it
// allowing to map it directly to a filesystem object.
type FilestoreNode struct {
ipld.Node
PosInfo *PosInfo
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment