diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..2bf34b5c43a8ce6e2e07090b3b1653a5e58e1d5d --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +sudo: false + +language: go +go: + - 1.9 + +install: + - go get github.com/whyrusleeping/gx + - go get github.com/whyrusleeping/gx-go +script: + - make test + +after_success: + - bash <(curl -s https://codecov.io/bash) + +cache: + directories: + - $GOPATH/src/gx + +notifications: +email: false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e4224df5b7a109818bddc7862137f495f2c2b82e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +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. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..73f2841f618b54e03cb34a9c91c8a0596a829c31 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +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 + gx test -v -race -coverprofile=coverage.txt -covermode=atomic . +rw: + gx-go rewrite +rwundo: + gx-go rewrite --undo +publish: rwundo + gx publish +.PHONY: all gx deps test rw rwundo publish + + diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..df2157fc2560eced888fd5c6ada8ddeadf456ec8 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# go-ipfs-pq + +[![](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-pq?status.svg)](https://godoc.org/github.com/ipfs/go-ipfs-pq) +[![Build Status](https://travis-ci.org/ipfs/go-ipfs-pq.svg?branch=master)](https://travis-ci.org/ipfs/go-ipfs-pq) + +> go-ipfs-pq implements a priority queue. + +## Table of Contents + +- [Install](#install) +- [Usage](#usage) +- [Contribute](#contribute) +- [License](#license) + +## Install + +`go-ipfs-pq` works like a regular Go module: + +``` +> go get github.com/ipfs/go-ipfs-pq +``` + +## Usage + +``` +import "github.com/ipfs/go-ipfs-pq" +``` + +Check the [GoDoc documentation](https://godoc.org/github.com/ipfs/go-ipfs-pq) + +## 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. diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5105d43701642c4d85640d04edc547a97fed9512 --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "author": "hsanjuan", + "bugs": { + "url": "https://github.com/ipfs/go-ipfs-pq" + }, + "gx": { + "dvcsimport": "github.com/ipfs/go-ipfs-pq" + }, + "gxVersion": "0.12.1", + "language": "go", + "license": "MIT", + "name": "go-ipfs-pq", + "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", + "version": "0.0.0" +} + diff --git a/container.go b/pq.go similarity index 98% rename from container.go rename to pq.go index 9f20c31c701c287585ed84b516ef42d72271f64d..28f40616d211d46780c02b1b64f834640c636bde 100644 --- a/container.go +++ b/pq.go @@ -1,3 +1,4 @@ +// Package pq implements a priority queue. package pq import "container/heap" diff --git a/container_test.go b/pq_test.go similarity index 100% rename from container_test.go rename to pq_test.go