Remove examples directory

This commit is contained in:
idk
2020-01-09 20:13:36 -05:00
parent 0608951c4c
commit 510cca77e3
5 changed files with 20 additions and 129 deletions

View File

@ -0,0 +1,20 @@
USER_GH=eyedeekay
VERSION=0.1.01
packagename=go-i2pcontrol
echo:
@echo "type make version to do release $(VERSION)"
version:
gothub release -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION) -d "version $(VERSION)"
del:
gothub delete -s $(GITHUB_TOKEN) -u $(USER_GH) -r $(packagename) -t v$(VERSION)
tar:
tar --exclude .git \
--exclude .go \
--exclude bin \
--exclude examples \
-cJvf ../$(packagename)_$(VERSION).orig.tar.xz .

View File

@ -1,58 +0,0 @@
UNAME ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
UARCH ?= $(shell uname -m | tr '[:upper:]' '[:lower:]' | sed 's|x86_64|amd64|g')
check:
go build ..
r: rebuild
rebuild: clean update demo
clean:
rm -f demo-*
update:
go get -u github.com/eyedeekay/go-i2pcontrol; true
demo:
GOOS="$(UNAME)" GOARCH="$(UARCH)" go build \
-a \
-tags netgo \
-ldflags '-w -extldflags "-static"' \
-o demo-"$(UNAME)" \
./demo.go
./demo-linux
demo-linux:
GOOS=linux GOARCH="$(UARCH)" go build \
-a \
-tags netgo \
-ldflags '-w -extldflags "-static"' \
-o demo-linux \
./demo.go
demo-win:
GOOS=windows GOARCH="$(UARCH)" go build \
-a \
-tags netgo \
-ldflags '-w -extldflags "-static"' \
-o demo-win \
./demo.go
demo-osx:
GOOS=darwin GOARCH="$(UARCH)" go build \
-a \
-tags netgo \
-ldflags '-w -extldflags "-static"' \
-o demo-osx \
./demo.go
all: demo-linux demo-win demo-osx
curl:
/usr/bin/curl -k --data-binary '{"jsonrpc":"2.0","id":"curltext","method":"Authenticate","params":{ "API": 1, "Password": "default"}}' -H 'content-type:application/json-rpc;' https://127.0.0.1:7650/
gofmt:
gofmt -w ../*.go ./*.go

View File

@ -1,39 +0,0 @@
package main
import (
"flag"
)
import ".."
func main() {
AddrString := flag.String("host", "127.0.0.1",
"host: of the i2pcontrol interface")
PortString := flag.String("port", "7650",
":port of the i2pcontrol interface")
ApiVersion := flag.Int("api", 1,
"version of the i2pcontrol interface")
Password := flag.String("pass", "default",
"password for authenticating to the i2pcontrol interface")
CertPath := flag.String("cert", "/var/lib/i2pd/i2pcontrol.cert.pem",
"password for authenticating to the i2pcontrol interface")
KeyPath := flag.String("key", "/var/lib/i2pd/i2pcontrol.key.pem",
"password for authenticating to the i2pcontrol interface")
Debug := flag.Bool("debug", true,
"version of the i2pcontrol interface")
flag.Parse()
apiversion := *ApiVersion
i2pcontrolhost := *AddrString
i2pcontrolport := *PortString
password := *Password
certpath := *CertPath
keypath := *KeyPath
i2pcontrol.I2pControlVerboseLogging = *Debug
auth := i2pcontrol.NewI2pControl(apiversion, certpath, keypath, password, i2pcontrolhost, i2pcontrolport)
auth.Echo("i2pcontrol")
}

View File

@ -1,5 +0,0 @@
package main
func main() {
}

View File

@ -1,27 +0,0 @@
type ApiPass struct {
API int
Password string
}
func NewApiPass(api int, password string) *ApiPass{
var a ApiPass
a.API = api
a.Password = password
return &a
}
type Authenticate struct {
id string
method string
params ApiPass
jsonrpc string
}
func NewAuthenticate(api int, id, method, jsonrpc, password string) *Authenticate{
var a Authenticate
a.id = id
a.method = method
a.jsonrpc = jsonrpc
a.params = *NewApiPass(api, password)
return &a
}