Revised bumper to put root directory name as package in version.go

This commit is contained in:
David Vennik
2022-12-23 18:22:40 +00:00
parent 1c336581b4
commit 14269c981b
5 changed files with 74 additions and 22 deletions

View File

@@ -114,10 +114,11 @@ func main() {
// Update SemVer
SemVer = fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch)
PathBase = tr.Filesystem.Root() + "/"
versionFile := `// Package indra is the root level package for Indranet, a low latency,
// Lightning Network monetised distributed VPN protocol designed for providing
// strong anonymity to valuable internet traffic.
package indra
var dir string
if dir, e = os.Getwd(); check(e) {
}
name := filepath.Base(dir)
versionFile := `package ` + name + `
import (
"fmt"

View File

@@ -141,6 +141,7 @@ func (c *Cursor) Inc(v int) Cursor {
type Bytes []byte
func ToBytes(b []byte) (msg Bytes) { return b }
func (m Bytes) String() string { return string(m) }
func (m Bytes) ToBytes() []byte { return m }
func (m Bytes) Len() int { return len(m) }
func (m Bytes) Zero() {

64
pkg/wire/codec.go Normal file
View File

@@ -0,0 +1,64 @@
package wire
import (
"github.com/Indra-Labs/indra"
"github.com/Indra-Labs/indra/pkg/slice"
"github.com/Indra-Labs/indra/pkg/types"
"github.com/Indra-Labs/indra/pkg/wire/cipher"
"github.com/Indra-Labs/indra/pkg/wire/confirmation"
"github.com/Indra-Labs/indra/pkg/wire/exit"
"github.com/Indra-Labs/indra/pkg/wire/forward"
"github.com/Indra-Labs/indra/pkg/wire/magicbytes"
"github.com/Indra-Labs/indra/pkg/wire/message"
"github.com/Indra-Labs/indra/pkg/wire/purchase"
"github.com/Indra-Labs/indra/pkg/wire/reply"
"github.com/Indra-Labs/indra/pkg/wire/response"
"github.com/Indra-Labs/indra/pkg/wire/session"
"github.com/Indra-Labs/indra/pkg/wire/token"
log2 "github.com/cybriq/proc/pkg/log"
)
var (
log = log2.GetLogger(indra.PathBase)
check = log.E.Chk
)
func EncodeOnion(on types.Onion) (b slice.Bytes) {
b = make(slice.Bytes, on.Len())
var sc slice.Cursor
c := &sc
on.Encode(b, c)
return
}
func PeelOnion(b slice.Bytes, c *slice.Cursor) (on types.Onion, e error) {
switch b[*c:c.Inc(magicbytes.Len)].String() {
case cipher.Magic.String():
var ci cipher.Type
if e = ci.Decode(b, c); check(e) {
return
}
on = &ci
case confirmation.Magic.String():
case exit.Magic.String():
case forward.Magic.String():
case message.Magic.String():
case purchase.Magic.String():
case reply.Magic.String():
case response.Magic.String():
case session.Magic.String():
case token.Magic.String():
default:
return
}
return
}

View File

@@ -1,14 +0,0 @@
package wire
import (
"github.com/Indra-Labs/indra/pkg/slice"
"github.com/Indra-Labs/indra/pkg/types"
)
func EncodeOnion(on types.Onion) (b slice.Bytes) {
b = make(slice.Bytes, on.Len())
var sc slice.Cursor
c := &sc
on.Encode(b, c)
return
}

View File

@@ -13,11 +13,11 @@ var (
// GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/main"
// ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "4e7c7db7646a5ec4975563b1e645b669989dc46c"
ParentGitCommit = "56e0fb915465bb9523d23f84280c01ba7072ca55"
// BuildTime stores the time when the current binary was built.
BuildTime = "2022-12-23T16:37:11Z"
BuildTime = "2022-12-23T18:22:40Z"
// SemVer lists the (latest) git tag on the build.
SemVer = "v0.0.218"
SemVer = "v0.0.219"
// PathBase is the path base returned from runtime caller.
PathBase = "/home/loki/src/github.com/Indra-Labs/indra/"
// Major is the major number from the tag.
@@ -25,7 +25,7 @@ var (
// Minor is the minor number from the tag.
Minor = 0
// Patch is the patch version number from the tag.
Patch = 218
Patch = 219
)
// Version returns a pretty printed version information string.