mirror of
https://github.com/go-i2p/go-i2pcontrol.git
synced 2025-07-12 17:48:55 -04:00
Remove examples directory
This commit is contained in:
20
Makefile
20
Makefile
@ -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 .
|
||||
|
@ -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
|
@ -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")
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
package main
|
||||
|
||||
func main() {
|
||||
|
||||
}
|
@ -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
|
||||
}
|
Reference in New Issue
Block a user