-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.go
More file actions
144 lines (124 loc) · 3.9 KB
/
Copy pathversion.go
File metadata and controls
144 lines (124 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* -----------------------------------------------------------------
* L o r d O f S c r i p t s (tm)
* Copyright (C)2026 Dídimo Grimaldo T.
* go-vault
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* A tagged Picture & Document Vault maker with SQL-like query
* capabilities.
*-----------------------------------------------------------------*/
package vault
import (
"fmt"
"runtime"
"strings"
"github.com/lordofscripts/goapp/app"
//_ "embed"
)
/* ----------------------------------------------------------------
* G l o b a l s
*-----------------------------------------------------------------*/
const (
_NAME string = "goVault"
_DESC string = "File vault maker with SQL-like query capability"
MANUAL_VERSION string = "1.1.0"
)
const (
// Useful Unicode Characters
CHR_COPYRIGHT = '\u00a9' // ©
CHR_REGISTERED = '\u00ae' // ®
CHR_GUILLEMET_L = '\u00ab' // «
CHR_GUILLEMET_R = '\u00bb' // »
CHR_TRADEMARK = '\u2122' // ™
CHR_SAMARITAN = '\u214f' // ⅏
CHR_PLACEOFINTEREST = '\u2318' // ⌘
CHR_HIGHVOLTAGE = '\u26a1' // ⚡
CHR_TRIDENT = rune(0x1f531) // 🔱
CHR_SPLATTER = rune(0x1fadf)
CHR_WARNING = '\u26a0' // ⚠
CHR_EXCLAMATION = '\u2757'
CHR_SKULL = '\u2620' // ☠
CO1 = "odlamirG omidiD 6202-5202)C("
CO2 = "stpircS fO droL 6202-5202)C("
CO3 = "gnitirwnitsol"
)
var (
ModuleVersion app.PackageVersion = app.NewReleaseCandidateVersion(_NAME, _DESC, MANUAL_VERSION, 3)
)
/* ----------------------------------------------------------------
* F u n c t i o n s
*-----------------------------------------------------------------*/
// Funny LordOfScripts logo
func Logo() string {
const (
whiteStar rune = '\u269d' // ⚝
unisex rune = '\u26a5' // ⚥
hotSpring rune = '\u2668' // ♨
leftConv rune = '\u269e' // ⚞
rightConv rune = '\u269f' // ⚟
eye rune = '\u25d5' // ◕
mouth rune = '\u035c' // ͜ ‿ \u203f
skull rune = '\u2620' // ☠
)
return fmt.Sprintf("%c%c%c %c%c", leftConv, eye, mouth, eye, rightConv)
//fmt.Sprintf("(%c%c %c)", eye, mouth, eye)
}
// Hey! My time costs money too!
func BuyMeCoffee(coffee4 ...string) {
const (
coffee rune = '\u2615' // ☕
)
var recipient string
if len(coffee4) == 0 {
recipient = Reverse(CO3)
} else {
recipient = coffee4[0]
}
fmt.Printf("\t%c Buy me a Coffee? https://www.buymeacoffee/%s\n", coffee, recipient)
}
func Copyright(owner string, withLogo bool) {
//fmt.Printf("\t\u2720 %s %s \u269d\n", Version, Reverse(owner))
fmt.Printf("\t%c %s %s %c\n", CHR_TRIDENT, ModuleVersion, Reverse(owner), CHR_TRIDENT)
fmt.Println("\t\t\t\t", Logo())
}
func Reverse(s string) string {
runes := []rune(s)
for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
runes[i], runes[j] = runes[j], runes[i]
}
return string(runes)
}
// get the current GO language version
func GoVersion() string {
ver := strings.Replace(runtime.Version(), "go", "", -1)
return ver
}
// retrieve the current GO language version and compare it
// to the minimum required. It returns the current version
// and whether the condition current >= min is fulfilled or not.
func GoVersionMin(min string) (string, bool) {
current := GoVersion()
ok := current >= min
return current, ok
}
/*
This commented part is used by the Makefile target that extracts it
to a temporary file, compiles it and uses it to print out the full
Module Version that includes attributes like Alpha,Beta,RC which the
plain old "make version" didn't
//>>>BEGIN Versioner
package main
import (
"os"
"fmt"
"strings"
"github.com/lordofscripts/govault"
)
func main() {
if len(os.Args) == 2 && strings.EqualFold(os.Args[1], "short") {
fmt.Println(vault.ModuleVersion.Short())
} else {
fmt.Println(vault.ModuleVersion)
}
}
//>>>END Versioner
*/