Skip to content

Commit

Permalink
repo: Update structure, add ci/cd pipeline
Browse files Browse the repository at this point in the history
tonobo committed Feb 20, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tonobo Tim Foerster
1 parent b3d573a commit 6d7da7b
Showing 8 changed files with 68 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.swp
mtr-bin
/dist
35 changes: 35 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
build:
binary: mtr
main: main.go
ldflags:
- >
-s -w
-X github.com/tonobo/mtr/cli.version={{.Version}}
-X github.com/tonobo/mtr/cli.date={{.Date}}
goos:
- linux
env:
- CGO_ENABLED=0

archive:
name_template: "{{.Binary}}_{{.Os}}_{{.Arch}}"

snapshot:
name_template: "{{.Tag}}"

checksum:
name_template: "mtr_checksums.txt"

nfpm:
vendor: Task
homepage: https://github.com/tonobo/mtr
maintainer: Tim Foerster <gh-mtr@moo.gl>
description: Golang native MTR
license: MIT
conflicts:
- mtr
formats:
- deb
- rpm
name_template: "{{.ProjectName}}_{{.Os}}_{{.Arch}}"

25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
language: go

go:
- 1.11.x

addons:
apt:
packages:
- rpm

env:
- GO111MODULE=on

script:
- go build -o mtr # currently there are no tests avaiable ...
- git reset --hard

deploy:
- provider: script
skip_cleanup: true
script: curl -sL http://git.io/goreleaser | bash
on:
tags: true
condition: $TRAVIS_OS_NAME = linux

13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# MTR

A MTR implementation written in golang, completly without shell-execs.
A MTR implementation written in golang, completely without shell-execs.

Just install with the following command:
```
go get -u github.com/tonobo/mtr
sudo setcap cap_net_raw+ep PATH-TO-GOMTR
```

**Note: This tool mayby called with sudo or as root, because it requires raw sockets.**
**Note: This tool maybe called with sudo or as root, because it requires raw sockets.**

## Output

@@ -86,11 +87,3 @@ Flags:
--max-hops int Maximal TTL count (default 64)
-t, --timeout duration ICMP reply timeout (default 800ms)
```

## Roadmap

* [ ] IPv6 Support
* [ ] HTTP API (Launch MTR and just receive Updates - Grpc, Websocket, HTTP-Polling?)
* [ ] PTR Lookup
* [ ] AS-Number Lookup
* [ ] Multi-Target Support at Hop-Level
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import (
tm "github.com/buger/goterm"
pj "github.com/hokaccha/go-prettyjson"
"github.com/spf13/cobra"
"github.com/tonobo/mtr/mtr"
"github.com/tonobo/mtr/pkg/mtr"
)

var (
2 changes: 1 addition & 1 deletion hop/hop.go → pkg/hop/hop.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"time"

gm "github.com/buger/goterm"
"github.com/tonobo/mtr/icmp"
"github.com/tonobo/mtr/pkg/icmp"
)

type HopStatistic struct {
File renamed without changes.
4 changes: 2 additions & 2 deletions mtr/mtr.go → pkg/mtr/mtr.go
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ import (
"time"

gm "github.com/buger/goterm"
"github.com/tonobo/mtr/hop"
"github.com/tonobo/mtr/icmp"
"github.com/tonobo/mtr/pkg/hop"
"github.com/tonobo/mtr/pkg/icmp"
)

type MTR struct {

0 comments on commit 6d7da7b

Please sign in to comment.