Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d30e778bd4 | |||
| 73e867f75a | |||
| 84b87d61f2 | |||
|
f62e7499ec
|
|||
|
1edc2712ed
|
|||
|
63c28b4141
|
|||
|
b01e659bb4
|
|||
|
0923fa7c09
|
|||
|
e19cb30713
|
|||
|
90dc6079d5
|
|||
|
5b5c262994
|
|||
|
44ec5e4804
|
|||
| 2054c04442 | |||
| 373d28d405 |
@@ -26,10 +26,14 @@ Potentially needs `export GOPRIVATE="git.blackforestbytes.com"`
|
|||||||
| cursortoken | Mike | MongoDB cursortoken implementation |
|
| cursortoken | Mike | MongoDB cursortoken implementation |
|
||||||
| pagination | Mike | Pagination implementation |
|
| pagination | Mike | Pagination implementation |
|
||||||
| | | |
|
| | | |
|
||||||
|
| ginext | Mike | gin wrapper |
|
||||||
|
| wsw | Mike | websocket wrapper |
|
||||||
|
| | | |
|
||||||
| totpext | Mike | Implementation of TOTP (2-Factor-Auth) |
|
| totpext | Mike | Implementation of TOTP (2-Factor-Auth) |
|
||||||
| termext | Mike | Utilities for terminals (mostly color output) |
|
| termext | Mike | Utilities for terminals (mostly color output) |
|
||||||
| confext | Mike | Parses environment configuration into structs |
|
| confext | Mike | Parses environment configuration into structs |
|
||||||
| cmdext | Mike | Runner for external commands/processes |
|
| cmdext | Mike | Runner for external commands/processes |
|
||||||
|
| excelext | Mike | Build Excel files |
|
||||||
| | | |
|
| | | |
|
||||||
| sq | Mike | Utility functions for sql based databases (primarily sqlite) |
|
| sq | Mike | Utility functions for sql based databases (primarily sqlite) |
|
||||||
| tst | Mike | Utility functions for unit tests |
|
| tst | Mike | Utility functions for unit tests |
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/format"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext"
|
"git.blackforestbytes.com/BlackForestBytes/goext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/cryptext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/cryptext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
|
||||||
|
"go/format"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -64,16 +64,17 @@ func GenerateCharsetIDSpecs(sourceDir string, destFile string, opt CSIDGenOption
|
|||||||
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
||||||
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
||||||
|
|
||||||
newChecksumStr := goext.GoextVersion
|
var newChecksumStr strings.Builder
|
||||||
|
newChecksumStr.WriteString(goext.GoextVersion)
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
newChecksumStr += "\n" + f.Name() + "\t" + cryptext.BytesSha256(content)
|
newChecksumStr.WriteString("\n" + f.Name() + "\t" + cryptext.BytesSha256(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr))
|
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr.String()))
|
||||||
|
|
||||||
if newChecksum != oldChecksum {
|
if newChecksum != oldChecksum {
|
||||||
fmt.Printf("[CSIDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
fmt.Printf("[CSIDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
||||||
|
|||||||
@@ -95,16 +95,17 @@ func _generateEnumSpecs(sourceDir string, destFile string, oldChecksum string, g
|
|||||||
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
||||||
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
||||||
|
|
||||||
newChecksumStr := goext.GoextVersion
|
var newChecksumStr strings.Builder
|
||||||
|
newChecksumStr.WriteString(goext.GoextVersion)
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", false, err
|
return "", "", false, err
|
||||||
}
|
}
|
||||||
newChecksumStr += "\n" + f.Name() + "\t" + cryptext.BytesSha256(content)
|
newChecksumStr.WriteString("\n" + f.Name() + "\t" + cryptext.BytesSha256(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr))
|
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr.String()))
|
||||||
|
|
||||||
if newChecksum != oldChecksum {
|
if newChecksum != oldChecksum {
|
||||||
fmt.Printf("[EnumGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
fmt.Printf("[EnumGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
||||||
@@ -213,7 +214,7 @@ func processEnumFile(basedir string, fn string, debugOutput bool) ([]EnumDef, st
|
|||||||
var descr *string = nil
|
var descr *string = nil
|
||||||
var data *map[string]any = nil
|
var data *map[string]any = nil
|
||||||
if comment != nil {
|
if comment != nil {
|
||||||
comment = langext.Ptr(strings.TrimSpace(*comment))
|
comment = new(strings.TrimSpace(*comment))
|
||||||
if strings.HasPrefix(*comment, "{") {
|
if strings.HasPrefix(*comment, "{") {
|
||||||
if v, ok := tryParseDataComment(*comment); ok {
|
if v, ok := tryParseDataComment(*comment); ok {
|
||||||
data = &v
|
data = &v
|
||||||
@@ -278,7 +279,7 @@ func tryParseDataComment(s string) (map[string]any, bool) {
|
|||||||
|
|
||||||
rv := reflect.ValueOf(v)
|
rv := reflect.ValueOf(v)
|
||||||
|
|
||||||
if rv.Kind() == reflect.Ptr && rv.IsNil() {
|
if rv.Kind() == reflect.Pointer && rv.IsNil() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if rv.Kind() == reflect.Bool {
|
if rv.Kind() == reflect.Bool {
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ import (
|
|||||||
_ "embed"
|
_ "embed"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go/format"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext"
|
"git.blackforestbytes.com/BlackForestBytes/goext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/cryptext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/cryptext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/rext"
|
||||||
|
"go/format"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@@ -63,16 +63,17 @@ func GenerateIDSpecs(sourceDir string, destFile string, opt IDGenOptions) error
|
|||||||
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
files = langext.ArrFilter(files, func(v os.DirEntry) bool { return !strings.HasSuffix(v.Name(), "_gen.go") })
|
||||||
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
langext.SortBy(files, func(v os.DirEntry) string { return v.Name() })
|
||||||
|
|
||||||
newChecksumStr := goext.GoextVersion
|
var newChecksumStr strings.Builder
|
||||||
|
newChecksumStr.WriteString(goext.GoextVersion)
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
content, err := os.ReadFile(path.Join(sourceDir, f.Name()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
newChecksumStr += "\n" + f.Name() + "\t" + cryptext.BytesSha256(content)
|
newChecksumStr.WriteString("\n" + f.Name() + "\t" + cryptext.BytesSha256(content))
|
||||||
}
|
}
|
||||||
|
|
||||||
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr))
|
newChecksum := cryptext.BytesSha256([]byte(newChecksumStr.String()))
|
||||||
|
|
||||||
if newChecksum != oldChecksum {
|
if newChecksum != oldChecksum {
|
||||||
fmt.Printf("[IDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
fmt.Printf("[IDGenerate] Checksum has changed ( %s -> %s ), will generate new file\n\n", oldChecksum, newChecksum)
|
||||||
|
|||||||
+2
-2
@@ -61,12 +61,12 @@ func (r *CommandRunner) Envs(env []string) *CommandRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *CommandRunner) EnsureExitcode(arg ...int) *CommandRunner {
|
func (r *CommandRunner) EnsureExitcode(arg ...int) *CommandRunner {
|
||||||
r.enforceExitCodes = langext.Ptr(langext.ForceArray(arg))
|
r.enforceExitCodes = new(langext.ForceArray(arg))
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *CommandRunner) FailOnExitCode() *CommandRunner {
|
func (r *CommandRunner) FailOnExitCode() *CommandRunner {
|
||||||
r.enforceExitCodes = langext.Ptr([]int{0})
|
r.enforceExitCodes = new([]int{0})
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -37,7 +37,7 @@ func run(opt CommandRunner) (CommandResult, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
preader := pipeReader{
|
preader := pipeReader{
|
||||||
lineBufferSize: langext.Ptr(128 * 1024 * 1024), // 128MB max size of a single line, is hopefully enough....
|
lineBufferSize: new(128 * 1024 * 1024), // 128MB max size of a single line, is hopefully enough....
|
||||||
stdout: stdoutPipe,
|
stdout: stdoutPipe,
|
||||||
stderr: stderrPipe,
|
stderr: stderrPipe,
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ func run(opt CommandRunner) (CommandResult, error) {
|
|||||||
|
|
||||||
if opt.enforceNoStderr {
|
if opt.enforceNoStderr {
|
||||||
listener = append(listener, genericCommandListener{
|
listener = append(listener, genericCommandListener{
|
||||||
_readRawStderr: langext.Ptr(func(v []byte) {
|
_readRawStderr: new(func(v []byte) {
|
||||||
if len(v) > 0 {
|
if len(v) > 0 {
|
||||||
stderrFailChan <- true
|
stderrFailChan <- true
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-15
@@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/syncext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/syncext"
|
||||||
"io"
|
"io"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -29,14 +30,14 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
stdoutBufferReader, stdoutBufferWriter := io.Pipe()
|
stdoutBufferReader, stdoutBufferWriter := io.Pipe()
|
||||||
stdout := ""
|
var stdout strings.Builder
|
||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 128)
|
buf := make([]byte, 128)
|
||||||
for {
|
for {
|
||||||
n, err := pr.stdout.Read(buf)
|
n, err := pr.stdout.Read(buf)
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
txt := string(buf[:n])
|
txt := string(buf[:n])
|
||||||
stdout += txt
|
stdout.WriteString(txt)
|
||||||
_, _ = stdoutBufferWriter.Write(buf[:n])
|
_, _ = stdoutBufferWriter.Write(buf[:n])
|
||||||
for _, lstr := range listener {
|
for _, lstr := range listener {
|
||||||
lstr.ReadRawStdout(buf[:n])
|
lstr.ReadRawStdout(buf[:n])
|
||||||
@@ -58,7 +59,7 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
stderrBufferReader, stderrBufferWriter := io.Pipe()
|
stderrBufferReader, stderrBufferWriter := io.Pipe()
|
||||||
stderr := ""
|
var stderr strings.Builder
|
||||||
go func() {
|
go func() {
|
||||||
buf := make([]byte, 128)
|
buf := make([]byte, 128)
|
||||||
for {
|
for {
|
||||||
@@ -66,7 +67,7 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
|
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
txt := string(buf[:n])
|
txt := string(buf[:n])
|
||||||
stderr += txt
|
stderr.WriteString(txt)
|
||||||
_, _ = stderrBufferWriter.Write(buf[:n])
|
_, _ = stderrBufferWriter.Write(buf[:n])
|
||||||
for _, lstr := range listener {
|
for _, lstr := range listener {
|
||||||
lstr.ReadRawStderr(buf[:n])
|
lstr.ReadRawStderr(buf[:n])
|
||||||
@@ -88,8 +89,7 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
|
|
||||||
// [3] collect stdout line-by-line
|
// [3] collect stdout line-by-line
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
scanner := bufio.NewScanner(stdoutBufferReader)
|
scanner := bufio.NewScanner(stdoutBufferReader)
|
||||||
if pr.lineBufferSize != nil {
|
if pr.lineBufferSize != nil {
|
||||||
scanner.Buffer([]byte{}, *pr.lineBufferSize)
|
scanner.Buffer([]byte{}, *pr.lineBufferSize)
|
||||||
@@ -105,13 +105,11 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
errch <- err
|
errch <- err
|
||||||
}
|
}
|
||||||
combch <- combevt{"", true}
|
combch <- combevt{"", true}
|
||||||
wg.Done()
|
})
|
||||||
}()
|
|
||||||
|
|
||||||
// [4] collect stderr line-by-line
|
// [4] collect stderr line-by-line
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Go(func() {
|
||||||
go func() {
|
|
||||||
scanner := bufio.NewScanner(stderrBufferReader)
|
scanner := bufio.NewScanner(stderrBufferReader)
|
||||||
if pr.lineBufferSize != nil {
|
if pr.lineBufferSize != nil {
|
||||||
scanner.Buffer([]byte{}, *pr.lineBufferSize)
|
scanner.Buffer([]byte{}, *pr.lineBufferSize)
|
||||||
@@ -127,13 +125,12 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
errch <- err
|
errch <- err
|
||||||
}
|
}
|
||||||
combch <- combevt{"", true}
|
combch <- combevt{"", true}
|
||||||
wg.Done()
|
})
|
||||||
}()
|
|
||||||
|
|
||||||
// [5] combine stdcombined
|
// [5] combine stdcombined
|
||||||
|
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
stdcombined := ""
|
var stdcombined strings.Builder
|
||||||
go func() {
|
go func() {
|
||||||
stopctr := 0
|
stopctr := 0
|
||||||
for stopctr < 2 {
|
for stopctr < 2 {
|
||||||
@@ -141,7 +138,7 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
if vvv.stop {
|
if vvv.stop {
|
||||||
stopctr++
|
stopctr++
|
||||||
} else {
|
} else {
|
||||||
stdcombined += vvv.line + "\n" // this comes from bufio.Scanner and has no newlines...
|
stdcombined.WriteString(vvv.line + "\n") // this comes from bufio.Scanner and has no newlines...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
@@ -154,5 +151,5 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
|
|||||||
return "", "", "", err
|
return "", "", "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return stdout, stderr, stdcombined, nil
|
return stdout.String(), stderr.String(), stdcombined.String(), nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,11 +101,11 @@ func processEnvOverrides(rval reflect.Value, delim string, prefix string) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (reflect.Value, error) {
|
func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (reflect.Value, error) {
|
||||||
if rvtype == reflect.TypeOf("") {
|
if rvtype == reflect.TypeFor[string]() {
|
||||||
|
|
||||||
return reflect.ValueOf(envval), nil
|
return reflect.ValueOf(envval), nil
|
||||||
|
|
||||||
} else if rvtype == reflect.TypeOf(int(0)) {
|
} else if rvtype == reflect.TypeFor[int]() {
|
||||||
|
|
||||||
envint, err := strconv.ParseInt(envval, 10, bits.UintSize)
|
envint, err := strconv.ParseInt(envval, 10, bits.UintSize)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -114,7 +114,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return reflect.ValueOf(int(envint)), nil
|
return reflect.ValueOf(int(envint)), nil
|
||||||
|
|
||||||
} else if rvtype == reflect.TypeOf(int64(0)) {
|
} else if rvtype == reflect.TypeFor[int64]() {
|
||||||
|
|
||||||
envint, err := strconv.ParseInt(envval, 10, 64)
|
envint, err := strconv.ParseInt(envval, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -123,7 +123,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return reflect.ValueOf(int64(envint)), nil
|
return reflect.ValueOf(int64(envint)), nil
|
||||||
|
|
||||||
} else if rvtype == reflect.TypeOf(int32(0)) {
|
} else if rvtype == reflect.TypeFor[int32]() {
|
||||||
|
|
||||||
envint, err := strconv.ParseInt(envval, 10, 32)
|
envint, err := strconv.ParseInt(envval, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -132,7 +132,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return reflect.ValueOf(int32(envint)), nil
|
return reflect.ValueOf(int32(envint)), nil
|
||||||
|
|
||||||
} else if rvtype == reflect.TypeOf(int8(0)) {
|
} else if rvtype == reflect.TypeFor[int8]() {
|
||||||
|
|
||||||
envint, err := strconv.ParseInt(envval, 10, 8)
|
envint, err := strconv.ParseInt(envval, 10, 8)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -141,7 +141,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return reflect.ValueOf(int8(envint)), nil
|
return reflect.ValueOf(int8(envint)), nil
|
||||||
|
|
||||||
} else if rvtype == reflect.TypeOf(time.Duration(0)) {
|
} else if rvtype == reflect.TypeFor[time.Duration]() {
|
||||||
|
|
||||||
dur, err := timeext.ParseDurationShortString(envval)
|
dur, err := timeext.ParseDurationShortString(envval)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -159,7 +159,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return reflect.ValueOf(tim), nil
|
return reflect.ValueOf(tim), nil
|
||||||
|
|
||||||
} else if rvtype.ConvertibleTo(reflect.TypeOf(int(0))) {
|
} else if rvtype.ConvertibleTo(reflect.TypeFor[int]()) {
|
||||||
|
|
||||||
envint, err := strconv.ParseInt(envval, 10, 8)
|
envint, err := strconv.ParseInt(envval, 10, 8)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -170,7 +170,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
|
|
||||||
return envcvl, nil
|
return envcvl, nil
|
||||||
|
|
||||||
} else if rvtype.ConvertibleTo(reflect.TypeOf(false)) {
|
} else if rvtype.ConvertibleTo(reflect.TypeFor[bool]()) {
|
||||||
|
|
||||||
if strings.TrimSpace(strings.ToLower(envval)) == "true" {
|
if strings.TrimSpace(strings.ToLower(envval)) == "true" {
|
||||||
return reflect.ValueOf(true).Convert(rvtype), nil
|
return reflect.ValueOf(true).Convert(rvtype), nil
|
||||||
@@ -184,7 +184,7 @@ func parseEnvToValue(envval string, fullEnvKey string, rvtype reflect.Type) (ref
|
|||||||
return reflect.Value{}, errors.New(fmt.Sprintf("Failed to parse env-config variable '%s' to <%s, ,bool> (value := '%s')", rvtype.Name(), fullEnvKey, envval))
|
return reflect.Value{}, errors.New(fmt.Sprintf("Failed to parse env-config variable '%s' to <%s, ,bool> (value := '%s')", rvtype.Name(), fullEnvKey, envval))
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if rvtype.ConvertibleTo(reflect.TypeOf("")) {
|
} else if rvtype.ConvertibleTo(reflect.TypeFor[string]()) {
|
||||||
|
|
||||||
envcvl := reflect.ValueOf(envval).Convert(rvtype)
|
envcvl := reflect.ValueOf(envval).Convert(rvtype)
|
||||||
return envcvl, nil
|
return envcvl, nil
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package cryptext
|
package cryptext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/totpext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/totpext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -32,7 +31,7 @@ func TestPassHashTOTP(t *testing.T) {
|
|||||||
|
|
||||||
tst.AssertFalse(t, ph.Verify("test123", nil))
|
tst.AssertFalse(t, ph.Verify("test123", nil))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
tst.AssertTrue(t, ph.Verify("test123", langext.Ptr(totpext.TOTP(sec))))
|
tst.AssertTrue(t, ph.Verify("test123", new(totpext.TOTP(sec))))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +140,7 @@ func TestPassHashUpgrade_V3_TOTP(t *testing.T) {
|
|||||||
|
|
||||||
tst.AssertFalse(t, ph.Verify("test123", nil))
|
tst.AssertFalse(t, ph.Verify("test123", nil))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
tst.AssertTrue(t, ph.Verify("test123", langext.Ptr(totpext.TOTP(sec))))
|
tst.AssertTrue(t, ph.Verify("test123", new(totpext.TOTP(sec))))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
|
|
||||||
ph, err = ph.Upgrade("test123")
|
ph, err = ph.Upgrade("test123")
|
||||||
@@ -153,7 +152,7 @@ func TestPassHashUpgrade_V3_TOTP(t *testing.T) {
|
|||||||
|
|
||||||
tst.AssertFalse(t, ph.Verify("test123", nil))
|
tst.AssertFalse(t, ph.Verify("test123", nil))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
tst.AssertTrue(t, ph.Verify("test123", langext.Ptr(totpext.TOTP(sec))))
|
tst.AssertTrue(t, ph.Verify("test123", new(totpext.TOTP(sec))))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,7 +192,7 @@ func TestPassHashUpgrade_V4_TOTP(t *testing.T) {
|
|||||||
|
|
||||||
tst.AssertFalse(t, ph.Verify("test123", nil))
|
tst.AssertFalse(t, ph.Verify("test123", nil))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
tst.AssertTrue(t, ph.Verify("test123", langext.Ptr(totpext.TOTP(sec))))
|
tst.AssertTrue(t, ph.Verify("test123", new(totpext.TOTP(sec))))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
|
|
||||||
ph, err = ph.Upgrade("test123")
|
ph, err = ph.Upgrade("test123")
|
||||||
@@ -205,6 +204,6 @@ func TestPassHashUpgrade_V4_TOTP(t *testing.T) {
|
|||||||
|
|
||||||
tst.AssertFalse(t, ph.Verify("test123", nil))
|
tst.AssertFalse(t, ph.Verify("test123", nil))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
tst.AssertTrue(t, ph.Verify("test123", langext.Ptr(totpext.TOTP(sec))))
|
tst.AssertTrue(t, ph.Verify("test123", new(totpext.TOTP(sec))))
|
||||||
tst.AssertFalse(t, ph.Verify("test124", nil))
|
tst.AssertFalse(t, ph.Verify("test124", nil))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,21 +7,21 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestPronouncablePasswordExt(t *testing.T) {
|
func TestPronouncablePasswordExt(t *testing.T) {
|
||||||
for i := 0; i < 20; i++ {
|
for i := range 20 {
|
||||||
pw, entropy := PronouncablePasswordExt(rand.New(rand.NewSource(int64(i))), 16)
|
pw, entropy := PronouncablePasswordExt(rand.New(rand.NewSource(int64(i))), 16)
|
||||||
fmt.Printf("[%.2f] => %s\n", entropy, pw)
|
fmt.Printf("[%.2f] => %s\n", entropy, pw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPronouncablePasswordSeeded(t *testing.T) {
|
func TestPronouncablePasswordSeeded(t *testing.T) {
|
||||||
for i := 0; i < 20; i++ {
|
for i := range 20 {
|
||||||
pw := PronouncablePasswordSeeded(int64(i), 8)
|
pw := PronouncablePasswordSeeded(int64(i), 8)
|
||||||
fmt.Printf("%s\n", pw)
|
fmt.Printf("%s\n", pw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPronouncablePassword(t *testing.T) {
|
func TestPronouncablePassword(t *testing.T) {
|
||||||
for i := 0; i < 20; i++ {
|
for i := range 20 {
|
||||||
pw := PronouncablePassword(i + 1)
|
pw := PronouncablePassword(i + 1)
|
||||||
fmt.Printf("%s\n", pw)
|
fmt.Printf("%s\n", pw)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,15 +90,17 @@ func TestBroadcast_SubscribeByIter(t *testing.T) {
|
|||||||
|
|
||||||
// Channel to communicate when message is received
|
// Channel to communicate when message is received
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
|
goroutineDone := make(chan struct{})
|
||||||
received := false
|
received := false
|
||||||
|
|
||||||
// Start a goroutine to use the iterator
|
// Start a goroutine to use the iterator
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(goroutineDone)
|
||||||
for msg := range iterSeq {
|
for msg := range iterSeq {
|
||||||
if msg == "hello" {
|
if msg == "hello" {
|
||||||
received = true
|
received = true
|
||||||
done <- true
|
done <- true
|
||||||
return // Stop iteration
|
return // Stop iteration — triggers Unsubscribe via yield returning false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -119,6 +121,14 @@ func TestBroadcast_SubscribeByIter(t *testing.T) {
|
|||||||
t.Fatal("Timed out waiting for message")
|
t.Fatal("Timed out waiting for message")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait for the goroutine to fully exit so Unsubscribe (triggered by the
|
||||||
|
// iterator cleanup when yield returns false) has completed.
|
||||||
|
select {
|
||||||
|
case <-goroutineDone:
|
||||||
|
case <-time.After(time.Second):
|
||||||
|
t.Fatal("Timed out waiting for goroutine to finish")
|
||||||
|
}
|
||||||
|
|
||||||
subCount := bb.SubscriberCount()
|
subCount := bb.SubscriberCount()
|
||||||
if subCount != 0 {
|
if subCount != 0 {
|
||||||
t.Fatalf("Expected 0 receivers, got %d", subCount)
|
t.Fatalf("Expected 0 receivers, got %d", subCount)
|
||||||
|
|||||||
@@ -97,10 +97,7 @@ func (d *DelayedCombiningInvoker) run() {
|
|||||||
|
|
||||||
for {
|
for {
|
||||||
d.syncLock.Lock()
|
d.syncLock.Lock()
|
||||||
timeOut := min(d.maxDelay-time.Since(d.initialRequestTime), d.delay-time.Since(d.lastRequestTime))
|
timeOut := max(min(d.maxDelay-time.Since(d.initialRequestTime), d.delay-time.Since(d.lastRequestTime)), 0)
|
||||||
if timeOut < 0 {
|
|
||||||
timeOut = 0
|
|
||||||
}
|
|
||||||
d.syncLock.Unlock()
|
d.syncLock.Unlock()
|
||||||
|
|
||||||
immediately := false
|
immediately := false
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ func ObjectMerge[T1 any, T2 any](base T1, override T2) T1 {
|
|||||||
fieldBase := reflBase.Field(i)
|
fieldBase := reflBase.Field(i)
|
||||||
fieldOvrd := reflOvrd.Field(i)
|
fieldOvrd := reflOvrd.Field(i)
|
||||||
|
|
||||||
if fieldBase.Kind() != reflect.Ptr || fieldOvrd.Kind() != reflect.Ptr {
|
if fieldBase.Kind() != reflect.Pointer || fieldOvrd.Kind() != reflect.Pointer {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package dataext
|
package dataext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -26,17 +25,17 @@ func TestObjectMerge(t *testing.T) {
|
|||||||
|
|
||||||
valueA := A{
|
valueA := A{
|
||||||
Field1: nil,
|
Field1: nil,
|
||||||
Field2: langext.Ptr("99"),
|
Field2: new("99"),
|
||||||
Field3: langext.Ptr(12.2),
|
Field3: new(12.2),
|
||||||
Field4: nil,
|
Field4: nil,
|
||||||
OnlyA: 1,
|
OnlyA: 1,
|
||||||
DiffType: 2,
|
DiffType: 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
valueB := B{
|
valueB := B{
|
||||||
Field1: langext.Ptr(12),
|
Field1: new(12),
|
||||||
Field2: nil,
|
Field2: nil,
|
||||||
Field3: langext.Ptr(13.2),
|
Field3: new(13.2),
|
||||||
Field4: nil,
|
Field4: nil,
|
||||||
OnlyB: 1,
|
OnlyB: 1,
|
||||||
DiffType: "X",
|
DiffType: "X",
|
||||||
|
|||||||
+29
-3
@@ -2,12 +2,13 @@ package dataext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/syncext"
|
|
||||||
"github.com/rs/xid"
|
|
||||||
"iter"
|
"iter"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/syncext"
|
||||||
|
"github.com/rs/xid"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PubSub is a simple Pub/Sub Broker
|
// PubSub is a simple Pub/Sub Broker
|
||||||
@@ -162,6 +163,31 @@ func (ps *PubSub[TNamespace, TData]) PublishWithTimeout(ns TNamespace, data TDat
|
|||||||
return subscriber, actualReceiver
|
return subscriber, actualReceiver
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PublishAsync sends `data` to all subscriber
|
||||||
|
// does not wait for subscriber (this method returns immediately), waits at most {timeout} seconds on channels (async)
|
||||||
|
func (ps *PubSub[TNamespace, TData]) PublishAsync(ns TNamespace, data TData, timeout time.Duration) (subscriber int) {
|
||||||
|
ps.masterLock.Lock()
|
||||||
|
subs := langext.ArrCopy(ps.subscriptions[ns])
|
||||||
|
ps.masterLock.Unlock()
|
||||||
|
|
||||||
|
subscriber = len(subs)
|
||||||
|
|
||||||
|
for _, sub := range subs {
|
||||||
|
go func() {
|
||||||
|
sub.subLock.Lock()
|
||||||
|
defer sub.subLock.Unlock()
|
||||||
|
|
||||||
|
if sub.Func != nil {
|
||||||
|
go func() { sub.Func(data) }()
|
||||||
|
} else if sub.Chan != nil {
|
||||||
|
_ = syncext.WriteChannelWithTimeout(sub.Chan, data, timeout)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
return subscriber
|
||||||
|
}
|
||||||
|
|
||||||
func (ps *PubSub[TNamespace, TData]) SubscribeByCallback(ns TNamespace, fn func(TData)) PubSubSubscription {
|
func (ps *PubSub[TNamespace, TData]) SubscribeByCallback(ns TNamespace, fn func(TData)) PubSubSubscription {
|
||||||
ps.masterLock.Lock()
|
ps.masterLock.Lock()
|
||||||
defer ps.masterLock.Unlock()
|
defer ps.masterLock.Unlock()
|
||||||
|
|||||||
+11
-1
@@ -129,15 +129,17 @@ func TestPubSub_SubscribeByIter(t *testing.T) {
|
|||||||
|
|
||||||
// Channel to communicate when message is received
|
// Channel to communicate when message is received
|
||||||
done := make(chan bool)
|
done := make(chan bool)
|
||||||
|
goroutineDone := make(chan struct{})
|
||||||
received := false
|
received := false
|
||||||
|
|
||||||
// Start a goroutine to use the iterator
|
// Start a goroutine to use the iterator
|
||||||
go func() {
|
go func() {
|
||||||
|
defer close(goroutineDone)
|
||||||
for msg := range iterSeq {
|
for msg := range iterSeq {
|
||||||
if msg == "hello" {
|
if msg == "hello" {
|
||||||
received = true
|
received = true
|
||||||
done <- true
|
done <- true
|
||||||
return // Stop iteration
|
return // Stop iteration — triggers Unsubscribe via yield returning false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
@@ -158,6 +160,14 @@ func TestPubSub_SubscribeByIter(t *testing.T) {
|
|||||||
t.Fatal("Timed out waiting for message")
|
t.Fatal("Timed out waiting for message")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wait for the goroutine to fully exit so Unsubscribe (triggered by the
|
||||||
|
// iterator cleanup when yield returns false) has completed.
|
||||||
|
select {
|
||||||
|
case <-goroutineDone:
|
||||||
|
case <-time.After(time.Second):
|
||||||
|
t.Fatal("Timed out waiting for goroutine to finish")
|
||||||
|
}
|
||||||
|
|
||||||
subCount := ps.SubscriberCount("test-ns")
|
subCount := ps.SubscriberCount("test-ns")
|
||||||
if subCount != 0 {
|
if subCount != 0 {
|
||||||
t.Fatalf("Expected 0 receivers, got %d", subCount)
|
t.Fatalf("Expected 0 receivers, got %d", subCount)
|
||||||
|
|||||||
+2
-3
@@ -2,7 +2,6 @@ package dataext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ func (s *Stack[T]) OptPop() *T {
|
|||||||
result := s.data[l-1]
|
result := s.data[l-1]
|
||||||
s.data = s.data[:l-1]
|
s.data = s.data[:l-1]
|
||||||
|
|
||||||
return langext.Ptr(result)
|
return new(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stack[T]) Peek() (T, error) {
|
func (s *Stack[T]) Peek() (T, error) {
|
||||||
@@ -94,7 +93,7 @@ func (s *Stack[T]) OptPeek() *T {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return langext.Ptr(s.data[l-1])
|
return new(s.data[l-1])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stack[T]) Length() int {
|
func (s *Stack[T]) Length() int {
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ func binarize(writer io.Writer, dat reflect.Value, opt StructHashOptions) error
|
|||||||
|
|
||||||
err = binary.Write(writer, binary.LittleEndian, uint8(dat.Kind()))
|
err = binary.Write(writer, binary.LittleEndian, uint8(dat.Kind()))
|
||||||
switch dat.Kind() {
|
switch dat.Kind() {
|
||||||
case reflect.Ptr, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice, reflect.Interface:
|
case reflect.Pointer, reflect.Map, reflect.Array, reflect.Chan, reflect.Slice, reflect.Interface:
|
||||||
if dat.IsNil() {
|
if dat.IsNil() {
|
||||||
err = binary.Write(writer, binary.LittleEndian, uint64(0))
|
err = binary.Write(writer, binary.LittleEndian, uint64(0))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package dataext
|
package dataext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -46,7 +45,7 @@ func TestStructHashSimpleStruct(t *testing.T) {
|
|||||||
tst.AssertHexEqual(t, "5d09090dc34ac59dd645f197a255f653387723de3afa1b614721ea5a081c675f", noErrStructHash(t, t0{
|
tst.AssertHexEqual(t, "5d09090dc34ac59dd645f197a255f653387723de3afa1b614721ea5a081c675f", noErrStructHash(t, t0{
|
||||||
F1: 10,
|
F1: 10,
|
||||||
F2: []string{"1", "2", "3"},
|
F2: []string{"1", "2", "3"},
|
||||||
F3: langext.Ptr(99),
|
F3: new(99),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,7 @@
|
|||||||
package enums
|
package enums
|
||||||
|
|
||||||
|
import "maps"
|
||||||
|
|
||||||
import "encoding/json"
|
import "encoding/json"
|
||||||
|
|
||||||
type Enum interface {
|
type Enum interface {
|
||||||
@@ -45,9 +47,7 @@ type EnumDataMetaValue struct {
|
|||||||
func (v EnumDataMetaValue) MarshalJSON() ([]byte, error) {
|
func (v EnumDataMetaValue) MarshalJSON() ([]byte, error) {
|
||||||
m := make(map[string]any, 8)
|
m := make(map[string]any, 8)
|
||||||
|
|
||||||
for k, dv := range v.Data {
|
maps.Copy(m, v.Data)
|
||||||
m[k] = dv
|
|
||||||
}
|
|
||||||
|
|
||||||
m["varName"] = v.VarName
|
m["varName"] = v.VarName
|
||||||
m["value"] = v.Value
|
m["value"] = v.Value
|
||||||
|
|||||||
@@ -0,0 +1,300 @@
|
|||||||
|
package excelext
|
||||||
|
|
||||||
|
import (
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/dataext"
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
excelize360 "github.com/360EntSecGroup-Skylar/excelize"
|
||||||
|
"github.com/xuri/excelize/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type excelMapperColDefinition[T any] struct {
|
||||||
|
style *int
|
||||||
|
header string
|
||||||
|
width *float64
|
||||||
|
fn func(T) (any, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExcelMapper[T any] struct {
|
||||||
|
StyleDate *int
|
||||||
|
StyleDatetime *int
|
||||||
|
StyleEUR *int
|
||||||
|
StylePercentage *int
|
||||||
|
StyleHeader *int
|
||||||
|
StyleWSHeader *int
|
||||||
|
|
||||||
|
SkipColumnHeader bool
|
||||||
|
|
||||||
|
sheetName string
|
||||||
|
wsHeader []dataext.Tuple[string, *int]
|
||||||
|
colDefinitions []excelMapperColDefinition[T]
|
||||||
|
colFilter []func(v T) bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewExcelMapper[T any]() (*ExcelMapper[T], error) {
|
||||||
|
|
||||||
|
em := &ExcelMapper[T]{
|
||||||
|
StyleDate: nil,
|
||||||
|
StyleDatetime: nil,
|
||||||
|
StyleEUR: nil,
|
||||||
|
StylePercentage: nil,
|
||||||
|
StyleHeader: nil,
|
||||||
|
StyleWSHeader: nil,
|
||||||
|
sheetName: "",
|
||||||
|
|
||||||
|
SkipColumnHeader: false,
|
||||||
|
|
||||||
|
wsHeader: make([]dataext.Tuple[string, *int], 0),
|
||||||
|
colDefinitions: make([]excelMapperColDefinition[T], 0),
|
||||||
|
}
|
||||||
|
|
||||||
|
return em, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) InitNewFile(sheetName string) (*excelize.File, error) {
|
||||||
|
f := excelize.NewFile()
|
||||||
|
|
||||||
|
defSheet := f.GetSheetList()[0]
|
||||||
|
|
||||||
|
sheet1 := sheetName
|
||||||
|
|
||||||
|
sheetIdx, err := f.NewSheet(sheet1)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
f.SetActiveSheet(sheetIdx)
|
||||||
|
err = f.DeleteSheet(defSheet)
|
||||||
|
|
||||||
|
err = em.InitStyles(f)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return f, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) InitStyles(f *excelize.File) error {
|
||||||
|
styleDate, err := f.NewStyle(&excelize.Style{
|
||||||
|
CustomNumFmt: new("dd.mm.yyyy"),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
styleDatetime, err := f.NewStyle(&excelize.Style{
|
||||||
|
NumFmt: 22,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
styleEUR, err := f.NewStyle(&excelize.Style{
|
||||||
|
NumFmt: 218,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
stylePercentage, err := f.NewStyle(&excelize.Style{
|
||||||
|
NumFmt: 10,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
styleHeader, err := f.NewStyle(&excelize.Style{
|
||||||
|
Font: &excelize.Font{Bold: true, Size: 11},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
styleWSHeader, err := f.NewStyle(&excelize.Style{
|
||||||
|
Font: &excelize.Font{Bold: true, Size: 24},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
em.StyleDate = &styleDate
|
||||||
|
em.StyleDatetime = &styleDatetime
|
||||||
|
em.StyleEUR = &styleEUR
|
||||||
|
em.StylePercentage = &stylePercentage
|
||||||
|
em.StyleHeader = &styleHeader
|
||||||
|
em.StyleWSHeader = &styleWSHeader
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) AddWorksheetHeader(header string, style *int) {
|
||||||
|
em.wsHeader = append(em.wsHeader, dataext.NewTuple(header, style))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) AddColumn(header string, style *int, width *float64, fn func(T) any) {
|
||||||
|
em.colDefinitions = append(em.colDefinitions, excelMapperColDefinition[T]{
|
||||||
|
style: style,
|
||||||
|
header: header,
|
||||||
|
width: width,
|
||||||
|
fn: func(t T) (any, error) { return fn(t), nil },
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) AddColumnErr(header string, style *int, width *float64, fn func(T) (any, error)) {
|
||||||
|
em.colDefinitions = append(em.colDefinitions, excelMapperColDefinition[T]{
|
||||||
|
style: style,
|
||||||
|
header: header,
|
||||||
|
width: width,
|
||||||
|
fn: fn,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) Build(sheetName string, data []T) ([]byte, error) {
|
||||||
|
f, err := em.InitNewFile(sheetName)
|
||||||
|
if err != nil {
|
||||||
|
return nil, exerr.Wrap(err, "failed to init new file").Build()
|
||||||
|
}
|
||||||
|
|
||||||
|
err = em.BuildSingleSheet(f, sheetName, data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, exerr.Wrap(err, "").Build()
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer, err := f.WriteToBuffer()
|
||||||
|
if err != nil {
|
||||||
|
return nil, exerr.Wrap(err, "failed to build xls").Build()
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.Bytes(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) BuildSingleSheet(f *excelize.File, sheetName string, data []T) error {
|
||||||
|
if em.StyleHeader == nil || em.StyleDate == nil || em.StyleDatetime == nil || em.StyleEUR == nil || em.StylePercentage == nil || em.StyleWSHeader == nil {
|
||||||
|
err := em.InitStyles(f)
|
||||||
|
if err != nil {
|
||||||
|
return exerr.Wrap(err, "failed to init styles").Build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rowOffset := 0
|
||||||
|
|
||||||
|
if len(em.wsHeader) > 0 {
|
||||||
|
for range em.wsHeader {
|
||||||
|
rowOffset += 1
|
||||||
|
}
|
||||||
|
rowOffset += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if !em.SkipColumnHeader {
|
||||||
|
for i, col := range em.colDefinitions {
|
||||||
|
err := f.SetCellValue(sheetName, c(rowOffset+1, i), col.header)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, col := range em.colDefinitions {
|
||||||
|
if col.style != nil {
|
||||||
|
err := f.SetColStyle(sheetName, excelize360.ToAlphaString(i), *col.style)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for i, col := range em.colDefinitions {
|
||||||
|
if col.width != nil {
|
||||||
|
err := f.SetColWidth(sheetName, excelize360.ToAlphaString(i), excelize360.ToAlphaString(i), *col.width)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err := f.SetRowStyle(sheetName, rowOffset+1, rowOffset+1, *em.StyleHeader)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(em.wsHeader) > 0 {
|
||||||
|
for i, hdr := range em.wsHeader {
|
||||||
|
style := *langext.CoalesceOpt(hdr.V2, em.StyleWSHeader)
|
||||||
|
|
||||||
|
err = f.SetCellValue(sheetName, c(i+1, 0), hdr.V1)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f.MergeCell(sheetName, c(i+1, 0), c(i+1, len(em.colDefinitions)-1))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = f.SetRowStyle(sheetName, 1, 1, style)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
iRow := rowOffset + 1
|
||||||
|
if !em.SkipColumnHeader {
|
||||||
|
iRow += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, dat := range data {
|
||||||
|
|
||||||
|
skip := false
|
||||||
|
for _, filter := range em.colFilter {
|
||||||
|
if !filter(dat) {
|
||||||
|
skip = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if skip {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
for iCol, col := range em.colDefinitions {
|
||||||
|
|
||||||
|
cellVal, err := col.fn(dat)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for reflect.ValueOf(cellVal).Kind() == reflect.Pointer && !reflect.ValueOf(cellVal).IsNil() {
|
||||||
|
cellVal = reflect.ValueOf(cellVal).Elem().Interface()
|
||||||
|
}
|
||||||
|
|
||||||
|
if langext.IsNil(cellVal) {
|
||||||
|
err = f.SetCellValue(sheetName, c(iRow, iCol), "")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = f.SetCellValue(sheetName, c(iRow, iCol), cellVal)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
iRow++
|
||||||
|
}
|
||||||
|
|
||||||
|
//for i, col := range em.colDefinitions {
|
||||||
|
// if col.width == nil {
|
||||||
|
// //TODO https://github.com/qax-os/excelize/pull/1386
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (em *ExcelMapper[T]) AddFilter(f func(v T) bool) {
|
||||||
|
em.colFilter = append(em.colFilter, f)
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package excelext
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/rfctime"
|
||||||
|
"github.com/360EntSecGroup-Skylar/excelize"
|
||||||
|
)
|
||||||
|
|
||||||
|
func c(row int, col int) string {
|
||||||
|
return excelize.ToAlphaString(col) + strconv.Itoa(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
func excelizeOptTime(t *rfctime.RFC3339NanoTime) any {
|
||||||
|
if t == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return t.Time()
|
||||||
|
}
|
||||||
|
|
||||||
|
func excelizeOptDate(t *rfctime.Date) any {
|
||||||
|
if t == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return t.TimeUTC()
|
||||||
|
}
|
||||||
+3
-3
@@ -277,11 +277,11 @@ func (b *Builder) Ints32(key string, val []int32) *Builder {
|
|||||||
return b.addMeta(key, MDTInt32Array, val)
|
return b.addMeta(key, MDTInt32Array, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Builder) Type(key string, cls interface{}) *Builder {
|
func (b *Builder) Type(key string, cls any) *Builder {
|
||||||
return b.addMeta(key, MDTString, fmt.Sprintf("%T", cls))
|
return b.addMeta(key, MDTString, fmt.Sprintf("%T", cls))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Builder) Interface(key string, val interface{}) *Builder {
|
func (b *Builder) Interface(key string, val any) *Builder {
|
||||||
return b.addMeta(key, MDTAny, newAnyWrap(val))
|
return b.addMeta(key, MDTAny, newAnyWrap(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -566,7 +566,7 @@ func (b *Builder) doLogFatal() {
|
|||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
func (b *Builder) addMeta(key string, mdtype metaDataType, val interface{}) *Builder {
|
func (b *Builder) addMeta(key string, mdtype metaDataType, val any) *Builder {
|
||||||
b.errorData.Meta.add(key, mdtype, val)
|
b.errorData.Meta.add(key, mdtype, val)
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-11
@@ -3,13 +3,14 @@ package exerr
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"maps"
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reflectTypeStr = reflect.TypeOf("")
|
var reflectTypeStr = reflect.TypeFor[string]()
|
||||||
|
|
||||||
func FromError(err error) *ExErr {
|
func FromError(err error) *ExErr {
|
||||||
|
|
||||||
@@ -152,20 +153,18 @@ func getForeignMeta(err error) (mm MetaMap) {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
rval := reflect.ValueOf(err)
|
rval := reflect.ValueOf(err)
|
||||||
if rval.Kind() == reflect.Interface || rval.Kind() == reflect.Ptr {
|
if rval.Kind() == reflect.Interface || rval.Kind() == reflect.Pointer {
|
||||||
rval = reflect.ValueOf(err).Elem()
|
rval = reflect.ValueOf(err).Elem()
|
||||||
}
|
}
|
||||||
|
|
||||||
mm.add("foreign.errortype", MDTString, rval.Type().String())
|
mm.add("foreign.errortype", MDTString, rval.Type().String())
|
||||||
|
|
||||||
for k, v := range addMetaPrefix("foreign", getReflectedMetaValues(err, 8)) {
|
maps.Copy(mm, addMetaPrefix("foreign", getReflectedMetaValues(err, 8)))
|
||||||
mm[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
return mm
|
return mm
|
||||||
}
|
}
|
||||||
|
|
||||||
func getReflectedMetaValues(value interface{}, remainingDepth int) map[string]MetaValue {
|
func getReflectedMetaValues(value any, remainingDepth int) map[string]MetaValue {
|
||||||
|
|
||||||
if remainingDepth <= 0 {
|
if remainingDepth <= 0 {
|
||||||
return map[string]MetaValue{}
|
return map[string]MetaValue{}
|
||||||
@@ -177,7 +176,7 @@ func getReflectedMetaValues(value interface{}, remainingDepth int) map[string]Me
|
|||||||
|
|
||||||
rval := reflect.ValueOf(value)
|
rval := reflect.ValueOf(value)
|
||||||
|
|
||||||
if rval.Type().Kind() == reflect.Ptr {
|
if rval.Type().Kind() == reflect.Pointer {
|
||||||
|
|
||||||
if rval.IsNil() {
|
if rval.IsNil() {
|
||||||
return map[string]MetaValue{"*": {DataType: MDTNil, Value: nil}}
|
return map[string]MetaValue{"*": {DataType: MDTNil, Value: nil}}
|
||||||
@@ -237,9 +236,7 @@ func getReflectedMetaValues(value interface{}, remainingDepth int) map[string]Me
|
|||||||
fieldname := fieldtype.Name
|
fieldname := fieldtype.Name
|
||||||
|
|
||||||
if fieldtype.IsExported() {
|
if fieldtype.IsExported() {
|
||||||
for k, v := range addMetaPrefix(fieldname, getReflectedMetaValues(rval.Field(i).Interface(), remainingDepth-1)) {
|
maps.Copy(m, addMetaPrefix(fieldname, getReflectedMetaValues(rval.Field(i).Interface(), remainingDepth-1)))
|
||||||
m[k] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func (e ErrorCategory) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e ErrorCategory) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (e ErrorCategory) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ func (e ErrorCategory) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,7 @@ func (e ErrorCategory) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&e))
|
val.Set(reflect.ValueOf(&e))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(e))
|
val.Set(reflect.ValueOf(e))
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func (e ErrorSeverity) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e ErrorSeverity) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (e ErrorSeverity) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ func (e ErrorSeverity) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ func (e ErrorSeverity) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&e))
|
val.Set(reflect.ValueOf(&e))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(e))
|
val.Set(reflect.ValueOf(e))
|
||||||
|
|||||||
+33
-31
@@ -4,13 +4,13 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/dataext"
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsontype"
|
"go.mongodb.org/mongo-driver/bson/bsontype"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/dataext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"reflect"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ErrorType struct {
|
type ErrorType struct {
|
||||||
@@ -20,40 +20,42 @@ type ErrorType struct {
|
|||||||
|
|
||||||
//goland:noinspection GoUnusedGlobalVariable
|
//goland:noinspection GoUnusedGlobalVariable
|
||||||
var (
|
var (
|
||||||
TypeInternal = NewType("INTERNAL_ERROR", langext.Ptr(500))
|
TypeInternal = NewType("INTERNAL_ERROR", new(500))
|
||||||
TypePanic = NewType("PANIC", langext.Ptr(500))
|
TypePanic = NewType("PANIC", new(500))
|
||||||
TypeNotImplemented = NewType("NOT_IMPLEMENTED", langext.Ptr(500))
|
TypeNotImplemented = NewType("NOT_IMPLEMENTED", new(500))
|
||||||
TypeAssert = NewType("ASSERT", langext.Ptr(500))
|
TypeAssert = NewType("ASSERT", new(500))
|
||||||
|
|
||||||
TypeMongoQuery = NewType("MONGO_QUERY", langext.Ptr(500))
|
TypeMongoQuery = NewType("MONGO_QUERY", new(500))
|
||||||
TypeCursorTokenDecode = NewType("CURSOR_TOKEN_DECODE", langext.Ptr(500))
|
TypeCursorTokenDecode = NewType("CURSOR_TOKEN_DECODE", new(500))
|
||||||
TypeMongoFilter = NewType("MONGO_FILTER", langext.Ptr(500))
|
TypeMongoFilter = NewType("MONGO_FILTER", new(500))
|
||||||
TypeMongoReflection = NewType("MONGO_REFLECTION", langext.Ptr(500))
|
TypeMongoReflection = NewType("MONGO_REFLECTION", new(500))
|
||||||
TypeMongoInvalidOpt = NewType("MONGO_INVALIDOPT", langext.Ptr(500))
|
TypeMongoInvalidOpt = NewType("MONGO_INVALIDOPT", new(500))
|
||||||
|
|
||||||
TypeSQLQuery = NewType("SQL_QUERY", langext.Ptr(500))
|
TypeSQLQuery = NewType("SQL_QUERY", new(500))
|
||||||
TypeSQLBuild = NewType("SQL_BUILD", langext.Ptr(500))
|
TypeSQLBuild = NewType("SQL_BUILD", new(500))
|
||||||
TypeSQLDecode = NewType("SQL_DECODE", langext.Ptr(500))
|
TypeSQLDecode = NewType("SQL_DECODE", new(500))
|
||||||
|
|
||||||
TypeWrap = NewType("Wrap", nil)
|
TypeWrap = NewType("Wrap", nil)
|
||||||
|
|
||||||
TypeBindFailURI = NewType("BINDFAIL_URI", langext.Ptr(400))
|
TypeBindFailURI = NewType("BINDFAIL_URI", new(400))
|
||||||
TypeBindFailQuery = NewType("BINDFAIL_QUERY", langext.Ptr(400))
|
TypeBindFailQuery = NewType("BINDFAIL_QUERY", new(400))
|
||||||
TypeBindFailJSON = NewType("BINDFAIL_JSON", langext.Ptr(400))
|
TypeBindFailJSON = NewType("BINDFAIL_JSON", new(400))
|
||||||
TypeBindFailFormData = NewType("BINDFAIL_FORMDATA", langext.Ptr(400))
|
TypeBindFailFormData = NewType("BINDFAIL_FORMDATA", new(400))
|
||||||
TypeBindFailHeader = NewType("BINDFAIL_HEADER", langext.Ptr(400))
|
TypeBindFailHeader = NewType("BINDFAIL_HEADER", new(400))
|
||||||
|
|
||||||
TypeMarshalEntityID = NewType("MARSHAL_ENTITY_ID", langext.Ptr(400))
|
TypeMarshalEntityID = NewType("MARSHAL_ENTITY_ID", new(400))
|
||||||
TypeInvalidCSID = NewType("INVALID_CSID", langext.Ptr(400))
|
TypeInvalidCSID = NewType("INVALID_CSID", new(400))
|
||||||
|
|
||||||
TypeGoogleStatuscode = NewType("GOOGLE_STATUSCODE", langext.Ptr(400))
|
TypeGoogleStatuscode = NewType("GOOGLE_STATUSCODE", new(400))
|
||||||
TypeGoogleResponse = NewType("GOOGLE_RESPONSE", langext.Ptr(400))
|
TypeGoogleResponse = NewType("GOOGLE_RESPONSE", new(400))
|
||||||
|
|
||||||
TypeUnauthorized = NewType("UNAUTHORIZED", langext.Ptr(401))
|
TypeUnauthorized = NewType("UNAUTHORIZED", new(401))
|
||||||
TypeAuthFailed = NewType("AUTH_FAILED", langext.Ptr(401))
|
TypeAuthFailed = NewType("AUTH_FAILED", new(401))
|
||||||
|
|
||||||
TypeInvalidImage = NewType("IMAGEEXT_INVALID_IMAGE", langext.Ptr(400))
|
TypeInvalidImage = NewType("IMAGEEXT_INVALID_IMAGE", new(400))
|
||||||
TypeInvalidMimeType = NewType("IMAGEEXT_INVALID_MIMETYPE", langext.Ptr(400))
|
TypeInvalidMimeType = NewType("IMAGEEXT_INVALID_MIMETYPE", new(400))
|
||||||
|
|
||||||
|
TypeWebsocket = NewType("WEBSOCKET", new(500))
|
||||||
|
|
||||||
// other values come from the downstream application that uses goext
|
// other values come from the downstream application that uses goext
|
||||||
)
|
)
|
||||||
@@ -110,7 +112,7 @@ func (e ErrorType) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e ErrorType) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (e ErrorType) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -122,7 +124,7 @@ func (e ErrorType) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -132,7 +134,7 @@ func (e ErrorType) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&e))
|
val.Set(reflect.ValueOf(&e))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(e))
|
val.Set(reflect.ValueOf(e))
|
||||||
|
|||||||
+35
-32
@@ -2,12 +2,13 @@ package exerr
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/rs/xid"
|
|
||||||
"github.com/rs/zerolog"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/rs/xid"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExErr struct {
|
type ExErr struct {
|
||||||
@@ -125,35 +126,37 @@ func (ee *ExErr) FormatLog(lvl LogPrintLevel) string {
|
|||||||
|
|
||||||
} else if lvl == LogPrintOverview {
|
} else if lvl == LogPrintOverview {
|
||||||
|
|
||||||
str := "[" + ee.RecursiveType().Key + "] <" + ee.UniqueID + "> " + strings.ReplaceAll(ee.RecursiveMessage(), "\n", " ") + "\n"
|
var str strings.Builder
|
||||||
|
str.WriteString("[" + ee.RecursiveType().Key + "] <" + ee.UniqueID + "> " + strings.ReplaceAll(ee.RecursiveMessage(), "\n", " ") + "\n")
|
||||||
|
|
||||||
for exk, exv := range ee.Extra {
|
for exk, exv := range ee.Extra {
|
||||||
str += fmt.Sprintf(" # [[[ %s ==> %v ]]]\n", exk, exv)
|
str.WriteString(fmt.Sprintf(" # [[[ %s ==> %v ]]]\n", exk, exv))
|
||||||
}
|
}
|
||||||
|
|
||||||
indent := ""
|
var indent strings.Builder
|
||||||
for curr := ee; curr != nil; curr = curr.OriginalError {
|
for curr := ee; curr != nil; curr = curr.OriginalError {
|
||||||
indent += " "
|
indent.WriteString(" ")
|
||||||
|
|
||||||
str += indent
|
str.WriteString(indent.String())
|
||||||
str += "-> "
|
str.WriteString("-> ")
|
||||||
strmsg := strings.Trim(curr.Message, " \r\n\t")
|
strmsg := strings.Trim(curr.Message, " \r\n\t")
|
||||||
if lbidx := strings.Index(curr.Message, "\n"); lbidx >= 0 {
|
if lbidx := strings.Index(curr.Message, "\n"); lbidx >= 0 {
|
||||||
strmsg = strmsg[0:lbidx]
|
strmsg = strmsg[0:lbidx]
|
||||||
}
|
}
|
||||||
strmsg = langext.StrLimit(strmsg, 61, "...")
|
strmsg = langext.StrLimit(strmsg, 61, "...")
|
||||||
str += strmsg
|
str.WriteString(strmsg)
|
||||||
str += "\n"
|
str.WriteString("\n")
|
||||||
|
|
||||||
}
|
}
|
||||||
return str
|
return str.String()
|
||||||
|
|
||||||
} else if lvl == LogPrintFull {
|
} else if lvl == LogPrintFull {
|
||||||
|
|
||||||
str := "[" + ee.RecursiveType().Key + "] <" + ee.UniqueID + "> " + strings.ReplaceAll(ee.RecursiveMessage(), "\n", " ") + "\n"
|
var str strings.Builder
|
||||||
|
str.WriteString("[" + ee.RecursiveType().Key + "] <" + ee.UniqueID + "> " + strings.ReplaceAll(ee.RecursiveMessage(), "\n", " ") + "\n")
|
||||||
|
|
||||||
for exk, exv := range ee.Extra {
|
for exk, exv := range ee.Extra {
|
||||||
str += fmt.Sprintf(" # [[[ %s ==> %v ]]]\n", exk, exv)
|
str.WriteString(fmt.Sprintf(" # [[[ %s ==> %v ]]]\n", exk, exv))
|
||||||
}
|
}
|
||||||
|
|
||||||
indent := ""
|
indent := ""
|
||||||
@@ -165,33 +168,33 @@ func (ee *ExErr) FormatLog(lvl LogPrintLevel) string {
|
|||||||
etype = "~"
|
etype = "~"
|
||||||
}
|
}
|
||||||
|
|
||||||
str += indent
|
str.WriteString(indent)
|
||||||
str += "-> ["
|
str.WriteString("-> [")
|
||||||
str += etype
|
str.WriteString(etype)
|
||||||
if curr.Category == CatForeign {
|
if curr.Category == CatForeign {
|
||||||
str += "|Foreign"
|
str.WriteString("|Foreign")
|
||||||
}
|
}
|
||||||
str += "] "
|
str.WriteString("] ")
|
||||||
str += strings.ReplaceAll(curr.Message, "\n", " ")
|
str.WriteString(strings.ReplaceAll(curr.Message, "\n", " "))
|
||||||
if curr.Caller != "" {
|
if curr.Caller != "" {
|
||||||
str += " (@ "
|
str.WriteString(" (@ ")
|
||||||
str += curr.Caller
|
str.WriteString(curr.Caller)
|
||||||
str += ")"
|
str.WriteString(")")
|
||||||
}
|
}
|
||||||
str += "\n"
|
str.WriteString("\n")
|
||||||
|
|
||||||
if curr.Meta.Any() {
|
if curr.Meta.Any() {
|
||||||
meta := indent + " {" + curr.Meta.FormatOneLine(240) + "}"
|
meta := indent + " {" + curr.Meta.FormatOneLine(240) + "}"
|
||||||
if len(meta) < 200 {
|
if len(meta) < 200 {
|
||||||
str += meta
|
str.WriteString(meta)
|
||||||
str += "\n"
|
str.WriteString("\n")
|
||||||
} else {
|
} else {
|
||||||
str += curr.Meta.FormatMultiLine(indent+" ", " ", 1024)
|
str.WriteString(curr.Meta.FormatMultiLine(indent+" ", " ", 1024))
|
||||||
str += "\n"
|
str.WriteString("\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return str
|
return str.String()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -201,7 +204,7 @@ func (ee *ExErr) FormatLog(lvl LogPrintLevel) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ee *ExErr) ShortLog(evt *zerolog.Event) {
|
func (ee *ExErr) ShortLog(evt *zerolog.Event) {
|
||||||
ee.Meta.Apply(evt, langext.Ptr(240)).Msg(ee.FormatLog(LogPrintShort))
|
ee.Meta.Apply(evt, new(240)).Msg(ee.FormatLog(LogPrintShort))
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecursiveMessage returns the message to show
|
// RecursiveMessage returns the message to show
|
||||||
@@ -254,7 +257,7 @@ func (ee *ExErr) RecursiveType() ErrorType {
|
|||||||
func (ee *ExErr) RecursiveStatuscode() *int {
|
func (ee *ExErr) RecursiveStatuscode() *int {
|
||||||
for curr := ee; curr != nil; curr = curr.OriginalError {
|
for curr := ee; curr != nil; curr = curr.OriginalError {
|
||||||
if curr.StatusCode != nil {
|
if curr.StatusCode != nil {
|
||||||
return langext.Ptr(*curr.StatusCode)
|
return new(*curr.StatusCode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +282,7 @@ func (ee *ExErr) RecursiveCategory() ErrorCategory {
|
|||||||
func (ee *ExErr) RecursiveMeta(key string) *MetaValue {
|
func (ee *ExErr) RecursiveMeta(key string) *MetaValue {
|
||||||
for curr := ee; curr != nil; curr = curr.OriginalError {
|
for curr := ee; curr != nil; curr = curr.OriginalError {
|
||||||
if metaval, ok := curr.Meta[key]; ok {
|
if metaval, ok := curr.Meta[key]; ok {
|
||||||
return langext.Ptr(metaval)
|
return new(metaval)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,8 @@
|
|||||||
package exerr
|
package exerr
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"maps"
|
||||||
|
|
||||||
json "git.blackforestbytes.com/BlackForestBytes/goext/gojson"
|
json "git.blackforestbytes.com/BlackForestBytes/goext/gojson"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -50,9 +52,7 @@ func (ee *ExErr) toJson(depth int, applyExtendListener bool, outputMeta bool) la
|
|||||||
ginJson["meta"] = metaJson
|
ginJson["meta"] = metaJson
|
||||||
|
|
||||||
extraJson := langext.H{}
|
extraJson := langext.H{}
|
||||||
for extraKey, extraVal := range ee.Extra {
|
maps.Copy(extraJson, ee.Extra)
|
||||||
extraJson[extraKey] = extraVal
|
|
||||||
}
|
|
||||||
ginJson["extra"] = extraJson
|
ginJson["extra"] = extraJson
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-20
@@ -49,13 +49,13 @@ const (
|
|||||||
|
|
||||||
type MetaValue struct {
|
type MetaValue struct {
|
||||||
DataType metaDataType `json:"dataType"`
|
DataType metaDataType `json:"dataType"`
|
||||||
Value interface{} `json:"value"`
|
Value any `json:"value"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type metaValueSerialization struct {
|
type metaValueSerialization struct {
|
||||||
DataType metaDataType `bson:"dataType"`
|
DataType metaDataType `bson:"dataType"`
|
||||||
Value string `bson:"value"`
|
Value string `bson:"value"`
|
||||||
Raw interface{} `bson:"raw"`
|
Raw any `bson:"raw"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v MetaValue) SerializeValue() (string, error) {
|
func (v MetaValue) SerializeValue() (string, error) {
|
||||||
@@ -379,7 +379,7 @@ func (v *MetaValue) Deserialize(value string, datatype metaDataType) error {
|
|||||||
v.DataType = datatype
|
v.DataType = datatype
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
v.Value = langext.Ptr(value[1:])
|
v.Value = new(value[1:])
|
||||||
v.DataType = datatype
|
v.DataType = datatype
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -694,28 +694,28 @@ func (v MetaValue) rawValueForJson() any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mm MetaMap) FormatOneLine(singleMaxLen int) string {
|
func (mm MetaMap) FormatOneLine(singleMaxLen int) string {
|
||||||
r := ""
|
var r strings.Builder
|
||||||
|
|
||||||
i := 0
|
i := 0
|
||||||
for key, val := range mm {
|
for key, val := range mm {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
r += ", "
|
r.WriteString(", ")
|
||||||
}
|
}
|
||||||
|
|
||||||
r += "\"" + key + "\""
|
r.WriteString("\"" + key + "\"")
|
||||||
r += ": "
|
r.WriteString(": ")
|
||||||
r += "\"" + val.ShortString(singleMaxLen) + "\""
|
r.WriteString("\"" + val.ShortString(singleMaxLen) + "\"")
|
||||||
|
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mm MetaMap) FormatMultiLine(indentFront string, indentKeys string, maxLenValue int) string {
|
func (mm MetaMap) FormatMultiLine(indentFront string, indentKeys string, maxLenValue int) string {
|
||||||
r := ""
|
var r strings.Builder
|
||||||
|
|
||||||
r += indentFront + "{" + "\n"
|
r.WriteString(indentFront + "{" + "\n")
|
||||||
for key, val := range mm {
|
for key, val := range mm {
|
||||||
if key == "gin.body" {
|
if key == "gin.body" {
|
||||||
continue
|
continue
|
||||||
@@ -724,16 +724,16 @@ func (mm MetaMap) FormatMultiLine(indentFront string, indentKeys string, maxLenV
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
r += indentFront
|
r.WriteString(indentFront)
|
||||||
r += indentKeys
|
r.WriteString(indentKeys)
|
||||||
r += "\"" + key + "\""
|
r.WriteString("\"" + key + "\"")
|
||||||
r += ": "
|
r.WriteString(": ")
|
||||||
r += "\"" + val.ShortString(maxLenValue) + "\""
|
r.WriteString("\"" + val.ShortString(maxLenValue) + "\"")
|
||||||
r += ",\n"
|
r.WriteString(",\n")
|
||||||
}
|
}
|
||||||
r += indentFront + "}"
|
r.WriteString(indentFront + "}")
|
||||||
|
|
||||||
return r
|
return r.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mm MetaMap) Any() bool {
|
func (mm MetaMap) Any() bool {
|
||||||
@@ -747,7 +747,7 @@ func (mm MetaMap) Apply(evt *zerolog.Event, limitLen *int) *zerolog.Event {
|
|||||||
return evt
|
return evt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mm MetaMap) add(key string, mdtype metaDataType, val interface{}) {
|
func (mm MetaMap) add(key string, mdtype metaDataType, val any) {
|
||||||
if _, ok := mm[key]; !ok {
|
if _, ok := mm[key]; !ok {
|
||||||
mm[key] = MetaValue{DataType: mdtype, Value: val}
|
mm[key] = MetaValue{DataType: mdtype, Value: val}
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -104,3 +104,17 @@ func WrapHTTPHandlerFunc(w *GinWrapper, fn http.HandlerFunc) gin.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func WrapExtHTTPHandlerFunc(w *GinWrapper, fn func(*gin.Context, http.ResponseWriter, *http.Request)) gin.HandlerFunc {
|
||||||
|
return func(g *gin.Context) {
|
||||||
|
for _, lstr := range w.listenerBeforeRequest {
|
||||||
|
lstr(g)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn(g, g.Writer, g.Request)
|
||||||
|
|
||||||
|
for _, lstr := range w.listenerAfterRequest {
|
||||||
|
lstr(g, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+14
-14
@@ -4,11 +4,11 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"github.com/gin-gonic/gin/binding"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/dataext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/dataext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/gin-gonic/gin/binding"
|
||||||
"io"
|
"io"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"time"
|
"time"
|
||||||
@@ -84,7 +84,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailURI).
|
WithType(exerr.TypeBindFailURI).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.uri)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.uri)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "URI", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "URI", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailQuery).
|
WithType(exerr.TypeBindFailQuery).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "QUERY", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "QUERY", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailJSON).
|
WithType(exerr.TypeBindFailJSON).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err := pctx.ginCtx.ShouldBindJSON(pctx.body); err != nil {
|
if err := pctx.ginCtx.ShouldBindJSON(pctx.body); err != nil {
|
||||||
@@ -116,14 +116,14 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailJSON).
|
WithType(exerr.TypeBindFailJSON).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !pctx.ignoreWrongContentType {
|
if !pctx.ignoreWrongContentType {
|
||||||
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "JSON", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,14 +132,14 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
if brc, ok := pctx.ginCtx.Request.Body.(dataext.BufferedReadCloser); ok {
|
if brc, ok := pctx.ginCtx.Request.Body.(dataext.BufferedReadCloser); ok {
|
||||||
v, err := brc.BufferedAll()
|
v, err := brc.BufferedAll()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||||
}
|
}
|
||||||
*pctx.rawbody = v
|
*pctx.rawbody = v
|
||||||
} else {
|
} else {
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
_, err := io.Copy(buf, pctx.ginCtx.Request.Body)
|
_, err := io.Copy(buf, pctx.ginCtx.Request.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "BODY", err))
|
||||||
}
|
}
|
||||||
*pctx.rawbody = buf.Bytes()
|
*pctx.rawbody = buf.Bytes()
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailFormData).
|
WithType(exerr.TypeBindFailFormData).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
||||||
}
|
}
|
||||||
} else if pctx.ginCtx.ContentType() == "application/x-www-form-urlencoded" {
|
} else if pctx.ginCtx.ContentType() == "application/x-www-form-urlencoded" {
|
||||||
if err := pctx.ginCtx.ShouldBindWith(pctx.form, binding.Form); err != nil {
|
if err := pctx.ginCtx.ShouldBindWith(pctx.form, binding.Form); err != nil {
|
||||||
@@ -160,14 +160,14 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailFormData).
|
WithType(exerr.TypeBindFailFormData).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if !pctx.ignoreWrongContentType {
|
if !pctx.ignoreWrongContentType {
|
||||||
err := exerr.New(exerr.TypeBindFailFormData, "missing form body").
|
err := exerr.New(exerr.TypeBindFailFormData, "missing form body").
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "FORM", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
WithType(exerr.TypeBindFailHeader).
|
WithType(exerr.TypeBindFailHeader).
|
||||||
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
||||||
Build()
|
Build()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "HEADER", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "HEADER", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
|||||||
err := pctx.persistantData.sessionObj.Init(pctx.ginCtx, actx)
|
err := pctx.persistantData.sessionObj.Init(pctx.ginCtx, actx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
actx.Cancel()
|
actx.Cancel()
|
||||||
return CreateBackgroundAppContext(), nil, langext.Ptr(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "INIT", err))
|
return CreateBackgroundAppContext(), nil, new(pctx.wrapper.buildRequestBindError(pctx.ginCtx, "INIT", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package ginext
|
package ginext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type dataHTTPResponse struct {
|
type dataHTTPResponse struct {
|
||||||
@@ -42,7 +42,7 @@ func (j dataHTTPResponse) Statuscode() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j dataHTTPResponse) BodyString(*gin.Context) *string {
|
func (j dataHTTPResponse) BodyString(*gin.Context) *string {
|
||||||
return langext.Ptr(string(j.data))
|
return new(string(j.data))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j dataHTTPResponse) ContentType() string {
|
func (j dataHTTPResponse) ContentType() string {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package ginext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type downloadDataHTTPResponse struct {
|
type downloadDataHTTPResponse struct {
|
||||||
@@ -48,7 +48,7 @@ func (j downloadDataHTTPResponse) Statuscode() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j downloadDataHTTPResponse) BodyString(*gin.Context) *string {
|
func (j downloadDataHTTPResponse) BodyString(*gin.Context) *string {
|
||||||
return langext.Ptr(string(j.data))
|
return new(string(j.data))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j downloadDataHTTPResponse) ContentType() string {
|
func (j downloadDataHTTPResponse) ContentType() string {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package ginext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ func (j fileHTTPResponse) BodyString(*gin.Context) *string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(string(data))
|
return new(string(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j fileHTTPResponse) ContentType() string {
|
func (j fileHTTPResponse) ContentType() string {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package ginext
|
package ginext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@@ -56,7 +56,7 @@ func (j seekableResponse) Statuscode() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j seekableResponse) BodyString(*gin.Context) *string {
|
func (j seekableResponse) BodyString(*gin.Context) *string {
|
||||||
return langext.Ptr("(seekable)")
|
return new("(seekable)")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j seekableResponse) ContentType() string {
|
func (j seekableResponse) ContentType() string {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package ginext
|
package ginext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
type textHTTPResponse struct {
|
type textHTTPResponse struct {
|
||||||
@@ -41,7 +41,7 @@ func (j textHTTPResponse) Statuscode() int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (j textHTTPResponse) BodyString(*gin.Context) *string {
|
func (j textHTTPResponse) BodyString(*gin.Context) *string {
|
||||||
return langext.Ptr(j.data)
|
return new(j.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (j textHTTPResponse) ContentType() string {
|
func (j textHTTPResponse) ContentType() string {
|
||||||
|
|||||||
+34
-2
@@ -1,13 +1,14 @@
|
|||||||
package ginext
|
package ginext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
var anyMethods = []string{
|
var anyMethods = []string{
|
||||||
@@ -210,6 +211,37 @@ func (w *GinRouteBuilder) HandleRawHTTPHandlerFunc(f http.HandlerFunc) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *GinRouteBuilder) HandleExtHTTPHandlerFunc(f func(*gin.Context, http.ResponseWriter, *http.Request)) {
|
||||||
|
if w.routes.wrapper.bufferBody {
|
||||||
|
arr := make([]gin.HandlerFunc, 0, len(w.handlers)+1)
|
||||||
|
arr = append(arr, BodyBuffer)
|
||||||
|
arr = append(arr, w.handlers...)
|
||||||
|
w.handlers = arr
|
||||||
|
}
|
||||||
|
|
||||||
|
middlewareNames := langext.ArrMap(w.handlers, func(v gin.HandlerFunc) string { return nameOfFunction(v) })
|
||||||
|
|
||||||
|
w.handlers = append(w.handlers, WrapExtHTTPHandlerFunc(w.routes.wrapper, f))
|
||||||
|
|
||||||
|
methodName := w.method
|
||||||
|
|
||||||
|
if w.method == "*" {
|
||||||
|
methodName = "ANY"
|
||||||
|
for _, method := range anyMethods {
|
||||||
|
w.routes.routes.Handle(method, w.relPath, w.handlers...)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
w.routes.routes.Handle(w.method, w.relPath, w.handlers...)
|
||||||
|
}
|
||||||
|
|
||||||
|
w.routes.wrapper.routeSpecs = append(w.routes.wrapper.routeSpecs, ginRouteSpec{
|
||||||
|
Method: methodName,
|
||||||
|
URL: w.absPath,
|
||||||
|
Middlewares: middlewareNames,
|
||||||
|
Handler: "[HTTPHandlerFunc]",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (w *GinWrapper) NoRoute(handler WHandlerFunc) {
|
func (w *GinWrapper) NoRoute(handler WHandlerFunc) {
|
||||||
|
|
||||||
handlers := make([]gin.HandlerFunc, 0)
|
handlers := make([]gin.HandlerFunc, 0)
|
||||||
|
|||||||
@@ -1,71 +1,77 @@
|
|||||||
module git.blackforestbytes.com/BlackForestBytes/goext
|
module git.blackforestbytes.com/BlackForestBytes/goext
|
||||||
|
|
||||||
go 1.24.0
|
go 1.26.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gin-gonic/gin v1.11.0
|
github.com/gin-gonic/gin v1.12.0
|
||||||
github.com/glebarez/go-sqlite v1.22.0 // only needed for tests -.-
|
github.com/glebarez/go-sqlite v1.22.0 // only needed for tests -.-
|
||||||
github.com/jmoiron/sqlx v1.4.0
|
github.com/jmoiron/sqlx v1.4.0
|
||||||
github.com/rs/xid v1.6.0
|
github.com/rs/xid v1.6.0
|
||||||
github.com/rs/zerolog v1.34.0
|
github.com/rs/zerolog v1.35.1
|
||||||
go.mongodb.org/mongo-driver v1.17.8
|
go.mongodb.org/mongo-driver v1.17.9
|
||||||
golang.org/x/crypto v0.47.0
|
golang.org/x/crypto v0.50.0
|
||||||
golang.org/x/sys v0.40.0
|
golang.org/x/sys v0.43.0
|
||||||
golang.org/x/term v0.39.0
|
golang.org/x/term v0.42.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
|
github.com/gorilla/websocket v1.5.3
|
||||||
github.com/jung-kurt/gofpdf v1.16.2
|
github.com/jung-kurt/gofpdf v1.16.2
|
||||||
golang.org/x/net v0.49.0
|
github.com/xuri/excelize/v2 v2.10.1
|
||||||
golang.org/x/sync v0.19.0
|
golang.org/x/sync v0.20.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/bytedance/gopkg v0.1.3 // indirect
|
github.com/bytedance/gopkg v0.1.4 // indirect
|
||||||
github.com/bytedance/sonic v1.15.0 // indirect
|
github.com/bytedance/sonic v1.15.0 // indirect
|
||||||
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
github.com/bytedance/sonic/loader v0.5.1 // indirect
|
||||||
github.com/cloudwego/base64x v0.1.6 // indirect
|
github.com/cloudwego/base64x v0.1.6 // indirect
|
||||||
github.com/cloudwego/iasm v0.2.0 // indirect
|
|
||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
|
||||||
github.com/gin-contrib/sse v1.1.0 // indirect
|
github.com/gin-contrib/sse v1.1.1 // indirect
|
||||||
github.com/go-playground/locales v0.14.1 // indirect
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/go-playground/validator/v10 v10.30.1 // indirect
|
github.com/go-playground/validator/v10 v10.30.2 // indirect
|
||||||
github.com/goccy/go-json v0.10.5 // indirect
|
github.com/goccy/go-json v0.10.6 // indirect
|
||||||
github.com/goccy/go-yaml v1.19.2 // indirect
|
github.com/goccy/go-yaml v1.19.2 // indirect
|
||||||
github.com/golang/snappy v1.0.0 // indirect
|
github.com/golang/snappy v1.0.0 // indirect
|
||||||
github.com/google/uuid v1.5.0 // indirect
|
github.com/google/uuid v1.6.0 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/compress v1.18.3 // indirect
|
github.com/klauspost/compress v1.18.5 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
|
||||||
github.com/leodido/go-urn v1.4.0 // indirect
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.14 // indirect
|
github.com/mattn/go-colorable v0.1.14 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
github.com/mattn/go-isatty v0.0.21 // indirect
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/montanaflynn/stats v0.7.1 // indirect
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
github.com/montanaflynn/stats v0.9.0 // indirect
|
||||||
|
github.com/ncruces/go-strftime v1.0.0 // indirect
|
||||||
|
github.com/pelletier/go-toml/v2 v2.3.0 // indirect
|
||||||
github.com/quic-go/qpack v0.6.0 // indirect
|
github.com/quic-go/qpack v0.6.0 // indirect
|
||||||
github.com/quic-go/quic-go v0.59.0 // indirect
|
github.com/quic-go/quic-go v0.59.0 // indirect
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||||
|
github.com/richardlehane/mscfb v1.0.6 // indirect
|
||||||
|
github.com/richardlehane/msoleps v1.0.6 // indirect
|
||||||
|
github.com/tiendc/go-deepcopy v1.7.2 // indirect
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||||
github.com/ugorji/go/codec v1.3.1 // indirect
|
github.com/ugorji/go/codec v1.3.1 // indirect
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||||
github.com/xdg-go/scram v1.2.0 // indirect
|
github.com/xdg-go/scram v1.2.0 // indirect
|
||||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||||
|
github.com/xuri/efp v0.0.1 // indirect
|
||||||
|
github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 // indirect
|
||||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||||
go.uber.org/mock v0.6.0 // indirect
|
go.mongodb.org/mongo-driver/v2 v2.5.1 // indirect
|
||||||
golang.org/x/arch v0.23.0 // indirect
|
golang.org/x/arch v0.26.0 // indirect
|
||||||
golang.org/x/image v0.35.0 // indirect
|
golang.org/x/image v0.39.0 // indirect
|
||||||
golang.org/x/mod v0.31.0 // indirect
|
golang.org/x/net v0.53.0 // indirect
|
||||||
golang.org/x/text v0.33.0 // indirect
|
golang.org/x/text v0.36.0 // indirect
|
||||||
golang.org/x/tools v0.40.0 // indirect
|
|
||||||
google.golang.org/protobuf v1.36.11 // indirect
|
google.golang.org/protobuf v1.36.11 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
modernc.org/libc v1.72.0 // indirect
|
||||||
modernc.org/libc v1.37.6 // indirect
|
modernc.org/mathutil v1.7.1 // indirect
|
||||||
modernc.org/mathutil v1.6.0 // indirect
|
modernc.org/memory v1.11.0 // indirect
|
||||||
modernc.org/memory v1.7.2 // indirect
|
modernc.org/sqlite v1.49.1 // indirect
|
||||||
modernc.org/sqlite v1.28.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,64 +1,16 @@
|
|||||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1 h1:l55mJb6rkkaUzOpSsgEeKYtS6/0gHwBYyfo5Jcjv/Ks=
|
||||||
|
github.com/360EntSecGroup-Skylar/excelize v1.4.1/go.mod h1:vnax29X2usfl7HHkBrX5EvSCJcmH3dT9luvxzu8iGAE=
|
||||||
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
|
||||||
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
|
github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM=
|
||||||
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
|
github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4=
|
||||||
github.com/bytedance/sonic v1.12.3 h1:W2MGa7RCU1QTeYRTPE3+88mVC0yXmsRQRChiyVocVjU=
|
|
||||||
github.com/bytedance/sonic v1.12.3/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
|
|
||||||
github.com/bytedance/sonic v1.12.4 h1:9Csb3c9ZJhfUWeMtpCDCq6BUoH5ogfDFLUgQ/jG+R0k=
|
|
||||||
github.com/bytedance/sonic v1.12.4/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
|
|
||||||
github.com/bytedance/sonic v1.12.5 h1:hoZxY8uW+mT+OpkcUWw4k0fDINtOcVavEsGfzwzFU/w=
|
|
||||||
github.com/bytedance/sonic v1.12.5/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
|
|
||||||
github.com/bytedance/sonic v1.12.6 h1:/isNmCUF2x3Sh8RAp/4mh4ZGkcFAX/hLrzrK3AvpRzk=
|
|
||||||
github.com/bytedance/sonic v1.12.6/go.mod h1:B8Gt/XvtZ3Fqj+iSKMypzymZxw/FVwgIGKzMzT9r/rk=
|
|
||||||
github.com/bytedance/sonic v1.12.7 h1:CQU8pxOy9HToxhndH0Kx/S1qU/CuS9GnKYrGioDcU1Q=
|
|
||||||
github.com/bytedance/sonic v1.12.7/go.mod h1:tnbal4mxOMju17EGfknm2XyYcpyCnIROYOEYuemj13I=
|
|
||||||
github.com/bytedance/sonic v1.12.8 h1:4xYRVRlXIgvSZ4e8iVTlMF5szgpXd4AfvuWgA8I8lgs=
|
|
||||||
github.com/bytedance/sonic v1.12.8/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8=
|
|
||||||
github.com/bytedance/sonic v1.12.9 h1:Od1BvK55NnewtGaJsTDeAOSnLVO2BTSLOe0+ooKokmQ=
|
|
||||||
github.com/bytedance/sonic v1.12.9/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8=
|
|
||||||
github.com/bytedance/sonic v1.12.10 h1:uVCQr6oS5669E9ZVW0HyksTLfNS7Q/9hV6IVS4nEMsI=
|
|
||||||
github.com/bytedance/sonic v1.12.10/go.mod h1:uVvFidNmlt9+wa31S1urfwwthTWteBgG0hWuoKAXTx8=
|
|
||||||
github.com/bytedance/sonic v1.13.1 h1:Jyd5CIvdFnkOWuKXr+wm4Nyk2h0yAFsr8ucJgEasO3g=
|
|
||||||
github.com/bytedance/sonic v1.13.1/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
|
||||||
github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ=
|
|
||||||
github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
|
||||||
github.com/bytedance/sonic v1.13.3 h1:MS8gmaH16Gtirygw7jV91pDCN33NyMrPbN7qiYhEsF0=
|
|
||||||
github.com/bytedance/sonic v1.13.3/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
|
|
||||||
github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
|
|
||||||
github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
|
|
||||||
github.com/bytedance/sonic v1.14.1 h1:FBMC0zVz5XUmE4z9wF4Jey0An5FueFvOsTKKKtwIl7w=
|
|
||||||
github.com/bytedance/sonic v1.14.1/go.mod h1:gi6uhQLMbTdeP0muCnrjHLeCUPyb70ujhnNlhOylAFc=
|
|
||||||
github.com/bytedance/sonic v1.14.2 h1:k1twIoe97C1DtYUo+fZQy865IuHia4PR5RPiuGPPIIE=
|
|
||||||
github.com/bytedance/sonic v1.14.2/go.mod h1:T80iDELeHiHKSc0C9tubFygiuXoGzrkjKzX2quAx980=
|
|
||||||
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
|
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
|
||||||
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
|
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
|
||||||
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
github.com/bytedance/sonic/loader v0.5.1 h1:Ygpfa9zwRCCKSlrp5bBP/b/Xzc3VxsAW+5NIYXrOOpI=
|
||||||
github.com/bytedance/sonic/loader v0.2.0 h1:zNprn+lsIP06C/IqCHs3gPQIvnvpKbbxyXQP1iU4kWM=
|
github.com/bytedance/sonic/loader v0.5.1/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
|
||||||
github.com/bytedance/sonic/loader v0.2.0/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iCjjJv3+E=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.2 h1:jxAJuN9fOot/cyz5Q6dUuMJF5OqQ6+5GfA8FjjQ0R4o=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.2/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.3 h1:yctD0Q3v2NOGfSWPLPvG2ggA2kV6TS6s4wioyEqssH0=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.3/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=
|
|
||||||
github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
|
||||||
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
|
|
||||||
github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
|
|
||||||
github.com/bytedance/sonic/loader v0.4.0 h1:olZ7lEqcxtZygCK9EKYKADnpQoYkRQxaeY2NYzevs+o=
|
|
||||||
github.com/bytedance/sonic/loader v0.4.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
|
|
||||||
github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=
|
|
||||||
github.com/bytedance/sonic/loader v0.5.0/go.mod h1:AR4NYCk5DdzZizZ5djGqQ92eEhCCcdf5x77udYiSJRo=
|
|
||||||
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=
|
|
||||||
github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
|
||||||
github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4=
|
|
||||||
github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w=
|
|
||||||
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
github.com/cloudwego/base64x v0.1.6 h1:t11wG9AECkCDk5fMSoxmufanudBtJ+/HemLstXDLI2M=
|
||||||
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
github.com/cloudwego/base64x v0.1.6/go.mod h1:OFcloc187FXDaYHvrNIjxSe8ncn0OOM8gEHfghB2IPU=
|
||||||
github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg=
|
|
||||||
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
|
|
||||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
@@ -66,36 +18,12 @@ github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1
|
|||||||
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
||||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.5 h1:J7wGKdGu33ocBOhGy0z653k/lFKLFDPJMG8Gql0kxn4=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.5/go.mod h1:ibHel+/kbxn9x2407k1izTA1S81ku1z/DlgOW2QE0M4=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.6 h1:3+PzJTKLkvgjeTbts6msPJt4DixhT4YtFNf1gtGe3zc=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.6/go.mod h1:JX1qVKqZd40hUPpAfiNTe0Sne7hdfKSbOqqmkq8GCXc=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.7 h1:SKFKl7kD0RiPdbht0s7hFtjl489WcQ1VyPW8ZzUMYCA=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.7/go.mod h1:GDlAgAyIRT27BhFl53XNAFtfjzOkLaF35JdEG0P7LtU=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.9 h1:5k+WDwEsD9eTLL8Tz3L0VnmVh9QxGjRmjBvAG7U/oYY=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.9/go.mod h1:WnSQhFKJuBlRyLiKohA/2DtIlPFAbguNaG7QCHcyGok=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.11 h1:AQvxbp830wPhHTqc1u7nzoLT+ZFxGY7emj5DR5DYFik=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.11/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.12 h1:e9hWvmLYvtp846tLHam2o++qitpguFiYCKbn0w9jyqw=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.12/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
|
||||||
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
|
github.com/gabriel-vasile/mimetype v1.4.13 h1:46nXokslUBsAJE/wMsp5gtO500a4F3Nkz9Ufpk2AcUM=
|
||||||
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
github.com/gabriel-vasile/mimetype v1.4.13/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
github.com/gin-contrib/sse v1.1.1 h1:uGYpNwTacv5R68bSGMapo62iLTRa9l5zxGCps4hK6ko=
|
||||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
github.com/gin-contrib/sse v1.1.1/go.mod h1:QXzuVkA0YO7o/gun03UI1Q+FTI8ZV/n5t03kIQAI89s=
|
||||||
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
|
github.com/gin-gonic/gin v1.12.0 h1:b3YAbrZtnf8N//yjKeU2+MQsh2mY5htkZidOM7O0wG8=
|
||||||
github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0=
|
github.com/gin-gonic/gin v1.12.0/go.mod h1:VxccKfsSllpKshkBWgVgRniFFAzFb9csfngsqANjnLc=
|
||||||
github.com/gin-contrib/sse v1.1.0 h1:n0w2GMuUpWDVp7qSpvze6fAu9iRxJY4Hmj6AmBOU05w=
|
|
||||||
github.com/gin-contrib/sse v1.1.0/go.mod h1:hxRZ5gVpWMT7Z0B0gSNYqqsSCNIJMjzvm6fqCz9vjwM=
|
|
||||||
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
|
|
||||||
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
|
||||||
github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ=
|
|
||||||
github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
|
|
||||||
github.com/gin-gonic/gin v1.11.0 h1:OW/6PLjyusp2PPXtyxKHU0RbX6I/l28FTdDlae5ueWk=
|
|
||||||
github.com/gin-gonic/gin v1.11.0/go.mod h1:+iq/FyxlGzII0KHiBGjuNn4UNENUlKbGlNmc+W50Dls=
|
|
||||||
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
|
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
|
||||||
github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc=
|
github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc=
|
||||||
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||||
@@ -104,48 +32,27 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
|
|||||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
|
github.com/go-playground/validator/v10 v10.30.2 h1:JiFIMtSSHb2/XBUbWM4i/MpeQm9ZK2xqPNk8vgvu5JQ=
|
||||||
github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
github.com/go-playground/validator/v10 v10.30.2/go.mod h1:mAf2pIOVXjTEBrwUMGKkCWKKPs9NheYGabeB04txQSc=
|
||||||
github.com/go-playground/validator/v10 v10.23.0 h1:/PwmTwZhS0dPkav3cdK9kV1FsAmrL8sThn8IHr/sO+o=
|
|
||||||
github.com/go-playground/validator/v10 v10.23.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
|
|
||||||
github.com/go-playground/validator/v10 v10.24.0 h1:KHQckvo8G6hlWnrPX4NJJ+aBfWNAE/HH+qdL2cBpCmg=
|
|
||||||
github.com/go-playground/validator/v10 v10.24.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
|
|
||||||
github.com/go-playground/validator/v10 v10.25.0 h1:5Dh7cjvzR7BRZadnsVOzPhWsrwUr0nmsZJxEAnFLNO8=
|
|
||||||
github.com/go-playground/validator/v10 v10.25.0/go.mod h1:GGzBIJMuE98Ic/kJsBXbz1x/7cByt++cQ+YOuDM5wus=
|
|
||||||
github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k=
|
|
||||||
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
|
||||||
github.com/go-playground/validator/v10 v10.27.0 h1:w8+XrWVMhGkxOaaowyKH35gFydVHOvC0/uWoy2Fzwn4=
|
|
||||||
github.com/go-playground/validator/v10 v10.27.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
|
|
||||||
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
|
|
||||||
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
|
|
||||||
github.com/go-playground/validator/v10 v10.30.1 h1:f3zDSN/zOma+w6+1Wswgd9fLkdwy06ntQJp0BBvFG0w=
|
|
||||||
github.com/go-playground/validator/v10 v10.30.1/go.mod h1:oSuBIQzuJxL//3MelwSLD5hc2Tu889bF0Idm9Dg26cM=
|
|
||||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||||
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
|
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
|
||||||
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
||||||
github.com/goccy/go-json v0.10.4 h1:JSwxQzIqKfmFX1swYPpUThQZp/Ka4wzJdK0LWVytLPM=
|
|
||||||
github.com/goccy/go-json v0.10.4/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
|
||||||
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
|
|
||||||
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
|
|
||||||
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
|
|
||||||
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
|
||||||
github.com/goccy/go-yaml v1.19.0 h1:EmkZ9RIsX+Uq4DYFowegAuJo8+xdX3T/2dwNPXbxEYE=
|
|
||||||
github.com/goccy/go-yaml v1.19.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
|
||||||
github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=
|
github.com/goccy/go-yaml v1.19.2 h1:PmFC1S6h8ljIz6gMRBopkjP1TVT7xuwrButHID66PoM=
|
||||||
github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
github.com/goccy/go-yaml v1.19.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
|
||||||
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
|
||||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
|
||||||
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
|
||||||
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
|
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs=
|
||||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
|
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
|
||||||
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||||
|
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||||
|
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||||
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o=
|
||||||
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
|
github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY=
|
||||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
@@ -153,42 +60,18 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm
|
|||||||
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||||
github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5PtRc=
|
github.com/jung-kurt/gofpdf v1.16.2 h1:jgbatWHfRlPYiK85qgevsZTHviWXKwB1TTiKdz5PtRc=
|
||||||
github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0=
|
github.com/jung-kurt/gofpdf v1.16.2/go.mod h1:1hl7y57EsiPAkLbOwzpzqgx1A30nQCk/YmFV8S2vmK0=
|
||||||
github.com/klauspost/compress v1.17.10 h1:oXAz+Vh0PMUvJczoi+flxpnBEPxoER1IaAnU/NMPtT0=
|
github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE=
|
||||||
github.com/klauspost/compress v1.17.10/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
|
||||||
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
|
|
||||||
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
|
|
||||||
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
|
|
||||||
github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ=
|
|
||||||
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
|
|
||||||
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
|
|
||||||
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
|
|
||||||
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
|
||||||
github.com/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
|
|
||||||
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.9 h1:66ze0taIn2H33fBvCkXuv9BmCwDfafmiIVpKV9kKGuY=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.9/go.mod h1:rqkxqrZ1EhYM9G+hXH7YdowN5R5RGN6NK4QwQ3WMXF8=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
|
||||||
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y=
|
||||||
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0=
|
||||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
|
||||||
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
|
||||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
|
||||||
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
|
||||||
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
|
||||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
github.com/mattn/go-isatty v0.0.21 h1:xYae+lCNBP7QuW4PUnNG61ffM4hVIfm+zUzDuSzYLGs=
|
||||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
github.com/mattn/go-isatty v0.0.21/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4=
|
||||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
|
||||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
|
||||||
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
|
||||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
@@ -196,414 +79,149 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
|
|||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||||
github.com/montanaflynn/stats v0.7.1 h1:etflOAAHORrCC44V+aR6Ftzort912ZU+YLiSTuV8eaE=
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
|
||||||
github.com/montanaflynn/stats v0.7.1/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
|
github.com/montanaflynn/stats v0.9.0 h1:tsBJ0RXwph9BmAuFoCmqGv6e8xa0MENQ8m0ptKq29mQ=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
|
github.com/montanaflynn/stats v0.9.0/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w=
|
||||||
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.3.0 h1:k59bC/lIZREW0/iVaQR8nDHxVq8OVlIzYCOJf421CaM=
|
||||||
|
github.com/pelletier/go-toml/v2 v2.3.0/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
|
||||||
github.com/phpdave11/gofpdi v1.0.7/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
|
github.com/phpdave11/gofpdi v1.0.7/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
|
||||||
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
|
||||||
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||||
github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
|
|
||||||
github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
|
|
||||||
github.com/quic-go/quic-go v0.54.1 h1:4ZAWm0AhCb6+hE+l5Q1NAL0iRn/ZrMwqHRGQiFwj2eg=
|
|
||||||
github.com/quic-go/quic-go v0.54.1/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
|
|
||||||
github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk=
|
|
||||||
github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U=
|
|
||||||
github.com/quic-go/quic-go v0.57.1 h1:25KAAR9QR8KZrCZRThWMKVAwGoiHIrNbT72ULHTuI10=
|
|
||||||
github.com/quic-go/quic-go v0.57.1/go.mod h1:ly4QBAjHA2VhdnxhojRsCUOeJwKYg+taDlos92xb1+s=
|
|
||||||
github.com/quic-go/quic-go v0.58.0 h1:ggY2pvZaVdB9EyojxL1p+5mptkuHyX5MOSv4dgWF4Ug=
|
|
||||||
github.com/quic-go/quic-go v0.58.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
|
||||||
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
github.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=
|
||||||
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
github.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
github.com/richardlehane/mscfb v1.0.6 h1:eN3bvvZCp00bs7Zf52bxNwAx5lJDBK1tCuH19qq5aC8=
|
||||||
|
github.com/richardlehane/mscfb v1.0.6/go.mod h1:pe0+IUIc0AHh0+teNzBlJCtSyZdFOGgV4ZK9bsoV+Jo=
|
||||||
|
github.com/richardlehane/msoleps v1.0.6 h1:9BvkpjvD+iUBalUY4esMwv6uBkfOip/Lzvd93jvR9gg=
|
||||||
|
github.com/richardlehane/msoleps v1.0.6/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
|
||||||
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
|
github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU=
|
||||||
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0=
|
||||||
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8=
|
github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI=
|
||||||
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
|
github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw=
|
||||||
github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY=
|
|
||||||
github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ=
|
|
||||||
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
|
github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
|
github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
|
||||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
|
||||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
|
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||||
|
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||||
|
github.com/tiendc/go-deepcopy v1.7.2 h1:Ut2yYR7W9tWjTQitganoIue4UGxZwCcJy3orjrrIj44=
|
||||||
|
github.com/tiendc/go-deepcopy v1.7.2/go.mod h1:4bKjNC2r7boYOkD2IOuZpYjmlDdzjbpTRyCx+goBCJQ=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||||
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
|
|
||||||
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
|
||||||
github.com/ugorji/go/codec v1.2.14 h1:yOQvXCBc3Ij46LRkRoh4Yd5qK6LVOgi0bYOXfb7ifjw=
|
|
||||||
github.com/ugorji/go/codec v1.2.14/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
|
||||||
github.com/ugorji/go/codec v1.3.0 h1:Qd2W2sQawAfG8XSvzwhBeoGq71zXOC/Q1E9y/wUcsUA=
|
|
||||||
github.com/ugorji/go/codec v1.3.0/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
|
||||||
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
|
github.com/ugorji/go/codec v1.3.1 h1:waO7eEiFDwidsBN6agj1vJQ4AG7lh2yqXyOXqhgQuyY=
|
||||||
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
github.com/ugorji/go/codec v1.3.1/go.mod h1:pRBVtBSKl77K30Bv8R2P+cLSGaTtex6fsA2Wjqmfxj4=
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||||
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
|
|
||||||
github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4=
|
|
||||||
github.com/xdg-go/scram v1.2.0 h1:bYKF2AEwG5rqd1BumT4gAnvwU/M9nBp2pTSxeZw7Wvs=
|
github.com/xdg-go/scram v1.2.0 h1:bYKF2AEwG5rqd1BumT4gAnvwU/M9nBp2pTSxeZw7Wvs=
|
||||||
github.com/xdg-go/scram v1.2.0/go.mod h1:3dlrS0iBaWKYVt2ZfA4cj48umJZ+cAEbR6/SjLA88I8=
|
github.com/xdg-go/scram v1.2.0/go.mod h1:3dlrS0iBaWKYVt2ZfA4cj48umJZ+cAEbR6/SjLA88I8=
|
||||||
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8=
|
||||||
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM=
|
||||||
|
github.com/xuri/efp v0.0.1 h1:fws5Rv3myXyYni8uwj2qKjVaRP30PdjeYe2Y6FDsCL8=
|
||||||
|
github.com/xuri/efp v0.0.1/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||||
|
github.com/xuri/excelize/v2 v2.10.1 h1:V62UlqopMqha3kOpnlHy2CcRVw1V8E63jFoWUmMzxN0=
|
||||||
|
github.com/xuri/excelize/v2 v2.10.1/go.mod h1:iG5tARpgaEeIhTqt3/fgXCGoBRt4hNXgCp3tfXKoOIc=
|
||||||
|
github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9 h1:+C0TIdyyYmzadGaL/HBLbf3WdLgC29pgyhTjAT/0nuE=
|
||||||
|
github.com/xuri/nfp v0.0.2-0.20250530014748-2ddeb826f9a9/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
|
||||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
||||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.mongodb.org/mongo-driver v1.17.1 h1:Wic5cJIwJgSpBhe3lx3+/RybR5PiYRMpVFgO7cOHyIM=
|
go.mongodb.org/mongo-driver v1.17.9 h1:IexDdCuuNJ3BHrELgBlyaH9p60JXAvdzWR128q+U5tU=
|
||||||
go.mongodb.org/mongo-driver v1.17.1/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4=
|
go.mongodb.org/mongo-driver v1.17.9/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ=
|
||||||
go.mongodb.org/mongo-driver v1.17.2 h1:gvZyk8352qSfzyZ2UMWcpDpMSGEr1eqE4T793SqyhzM=
|
go.mongodb.org/mongo-driver/v2 v2.5.1 h1:j2U/Qp+wvueSpqitLCSZPT/+ZpVc1xzuwdHWwl7d8ro=
|
||||||
go.mongodb.org/mongo-driver v1.17.2/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
go.mongodb.org/mongo-driver/v2 v2.5.1/go.mod h1:yOI9kBsufol30iFsl1slpdq1I0eHPzybRWdyYUs8K/0=
|
||||||
go.mongodb.org/mongo-driver v1.17.3 h1:TQyXhnsWfWtgAhMtOgtYHMTkZIfBTpMTsMnd9ZBeHxQ=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.3/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.8 h1:BDP3+U3Y8K0vTrpqDJIRaXNhb/bKyoVeg6tIJsW5EhM=
|
|
||||||
go.mongodb.org/mongo-driver v1.17.8/go.mod h1:LlOhpH5NUEfhxcAwG0UEkMqwYcc4JU18gtCdGudk/tQ=
|
|
||||||
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||||
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||||
golang.org/x/arch v0.11.0 h1:KXV8WWKCXm6tRpLirl2szsO5j/oOODwZf4hATmGVNs4=
|
golang.org/x/arch v0.26.0 h1:jZ6dpec5haP/fUv1kLCbuJy6dnRrfX6iVK08lZBFpk4=
|
||||||
golang.org/x/arch v0.11.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
golang.org/x/arch v0.26.0/go.mod h1:0X+GdSIP+kL5wPmpK7sdkEVTt2XoYP0cSjQSbZBwOi8=
|
||||||
golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg=
|
|
||||||
golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
|
||||||
golang.org/x/arch v0.13.0 h1:KCkqVVV1kGg0X87TFysjCJ8MxtZEIU4Ja/yXGeoECdA=
|
|
||||||
golang.org/x/arch v0.13.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
|
||||||
golang.org/x/arch v0.14.0 h1:z9JUEZWr8x4rR0OU6c4/4t6E6jOZ8/QBS2bBYBm4tx4=
|
|
||||||
golang.org/x/arch v0.14.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
|
|
||||||
golang.org/x/arch v0.15.0 h1:QtOrQd0bTUnhNVNndMpLHNWrDmYzZ2KDqSrEymqInZw=
|
|
||||||
golang.org/x/arch v0.15.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE=
|
|
||||||
golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U=
|
|
||||||
golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE=
|
|
||||||
golang.org/x/arch v0.17.0 h1:4O3dfLzd+lQewptAHqjewQZQDyEdejz3VwgeYwkZneU=
|
|
||||||
golang.org/x/arch v0.17.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
|
||||||
golang.org/x/arch v0.18.0 h1:WN9poc33zL4AzGxqf8VtpKUnGvMi8O9lhNyBMF/85qc=
|
|
||||||
golang.org/x/arch v0.18.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
|
||||||
golang.org/x/arch v0.19.0 h1:LmbDQUodHThXE+htjrnmVD73M//D9GTH6wFZjyDkjyU=
|
|
||||||
golang.org/x/arch v0.19.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
|
||||||
golang.org/x/arch v0.20.0 h1:dx1zTU0MAE98U+TQ8BLl7XsJbgze2WnNKF/8tGp/Q6c=
|
|
||||||
golang.org/x/arch v0.20.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk=
|
|
||||||
golang.org/x/arch v0.21.0 h1:iTC9o7+wP6cPWpDWkivCvQFGAHDQ59SrSxsLPcnkArw=
|
|
||||||
golang.org/x/arch v0.21.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
|
||||||
golang.org/x/arch v0.22.0 h1:c/Zle32i5ttqRXjdLyyHZESLD/bB90DCU1g9l/0YBDI=
|
|
||||||
golang.org/x/arch v0.22.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
|
||||||
golang.org/x/arch v0.23.0 h1:lKF64A2jF6Zd8L0knGltUnegD62JMFBiCPBmQpToHhg=
|
|
||||||
golang.org/x/arch v0.23.0/go.mod h1:dNHoOeKiyja7GTvF9NJS1l3Z2yntpQNzgrjh1cU103A=
|
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw=
|
golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI=
|
||||||
golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U=
|
golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q=
|
||||||
golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ=
|
|
||||||
golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg=
|
|
||||||
golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY=
|
|
||||||
golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
|
||||||
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
|
|
||||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
|
||||||
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
|
|
||||||
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
|
|
||||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
|
||||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
|
||||||
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
|
|
||||||
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
|
|
||||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
|
||||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
|
||||||
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
|
|
||||||
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
|
|
||||||
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
|
|
||||||
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
|
|
||||||
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
|
|
||||||
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
|
|
||||||
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
|
|
||||||
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
|
|
||||||
golang.org/x/crypto v0.41.0 h1:WKYxWedPGCTVVl5+WHSSrOBT0O8lx32+zxmHxijgXp4=
|
|
||||||
golang.org/x/crypto v0.41.0/go.mod h1:pO5AFd7FA68rFak7rOAGVuygIISepHftHnr8dr6+sUc=
|
|
||||||
golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI=
|
|
||||||
golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8=
|
|
||||||
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
|
|
||||||
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
|
|
||||||
golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q=
|
|
||||||
golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4=
|
|
||||||
golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU=
|
|
||||||
golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0=
|
|
||||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
|
||||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
|
||||||
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
|
golang.org/x/image v0.39.0 h1:skVYidAEVKgn8lZ602XO75asgXBgLj9G/FE3RbuPFww=
|
||||||
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
|
golang.org/x/image v0.39.0/go.mod h1:sIbmppfU+xFLPIG0FoVUTvyBMmgng1/XAMhQ2ft0hpA=
|
||||||
golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g=
|
|
||||||
golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4=
|
|
||||||
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
|
|
||||||
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
|
|
||||||
golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ=
|
|
||||||
golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8=
|
|
||||||
golang.org/x/image v0.25.0 h1:Y6uW6rH1y5y/LK1J8BPWZtr6yZ7hrsy6hFrXjgsc2fQ=
|
|
||||||
golang.org/x/image v0.25.0/go.mod h1:tCAmOEGthTtkalusGp1g3xa2gke8J6c2N565dTyl9Rs=
|
|
||||||
golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY=
|
|
||||||
golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c=
|
|
||||||
golang.org/x/image v0.27.0 h1:C8gA4oWU/tKkdCfYT6T2u4faJu3MeNS5O8UPWlPF61w=
|
|
||||||
golang.org/x/image v0.27.0/go.mod h1:xbdrClrAUway1MUTEZDq9mz/UpRwYAkFFNUslZtcB+g=
|
|
||||||
golang.org/x/image v0.28.0 h1:gdem5JW1OLS4FbkWgLO+7ZeFzYtL3xClb97GaUzYMFE=
|
|
||||||
golang.org/x/image v0.28.0/go.mod h1:GUJYXtnGKEUgggyzh+Vxt+AviiCcyiwpsl8iQ8MvwGY=
|
|
||||||
golang.org/x/image v0.29.0 h1:HcdsyR4Gsuys/Axh0rDEmlBmB68rW1U9BUdB3UVHsas=
|
|
||||||
golang.org/x/image v0.29.0/go.mod h1:RVJROnf3SLK8d26OW91j4FrIHGbsJ8QnbEocVTOWQDA=
|
|
||||||
golang.org/x/image v0.30.0 h1:jD5RhkmVAnjqaCUXfbGBrn3lpxbknfN9w2UhHHU+5B4=
|
|
||||||
golang.org/x/image v0.30.0/go.mod h1:SAEUTxCCMWSrJcCy/4HwavEsfZZJlYxeHLc6tTiAe/c=
|
|
||||||
golang.org/x/image v0.31.0 h1:mLChjE2MV6g1S7oqbXC0/UcKijjm5fnJLUYKIYrLESA=
|
|
||||||
golang.org/x/image v0.31.0/go.mod h1:R9ec5Lcp96v9FTF+ajwaH3uGxPH4fKfHHAVbUILxghA=
|
|
||||||
golang.org/x/image v0.32.0 h1:6lZQWq75h7L5IWNk0r+SCpUJ6tUVd3v4ZHnbRKLkUDQ=
|
|
||||||
golang.org/x/image v0.32.0/go.mod h1:/R37rrQmKXtO6tYXAjtDLwQgFLHmhW+V6ayXlxzP2Pc=
|
|
||||||
golang.org/x/image v0.33.0 h1:LXRZRnv1+zGd5XBUVRFmYEphyyKJjQjCRiOuAP3sZfQ=
|
|
||||||
golang.org/x/image v0.33.0/go.mod h1:DD3OsTYT9chzuzTQt+zMcOlBHgfoKQb1gry8p76Y1sc=
|
|
||||||
golang.org/x/image v0.34.0 h1:33gCkyw9hmwbZJeZkct8XyR11yH889EQt/QH4VmXMn8=
|
|
||||||
golang.org/x/image v0.34.0/go.mod h1:2RNFBZRB+vnwwFil8GkMdRvrJOFd1AzdZI6vOY+eJVU=
|
|
||||||
golang.org/x/image v0.35.0 h1:LKjiHdgMtO8z7Fh18nGY6KDcoEtVfsgLDPeLyguqb7I=
|
|
||||||
golang.org/x/image v0.35.0/go.mod h1:MwPLTVgvxSASsxdLzKrl8BRFuyqMyGhLwmC+TO1Sybk=
|
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
|
golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=
|
||||||
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
|
golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=
|
||||||
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
|
|
||||||
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
|
|
||||||
golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk=
|
|
||||||
golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc=
|
|
||||||
golang.org/x/mod v0.31.0 h1:HaW9xtz0+kOcWKwli0ZXy79Ix+UW/vOfmWI5QVd2tgI=
|
|
||||||
golang.org/x/mod v0.31.0/go.mod h1:43JraMp9cGx1Rx3AqioxrbrhNsLl2l/iNAvuBkrezpg=
|
|
||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
|
golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA=
|
||||||
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
|
golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs=
|
||||||
golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo=
|
|
||||||
golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM=
|
|
||||||
golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI=
|
|
||||||
golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs=
|
|
||||||
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
|
|
||||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
|
||||||
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
|
|
||||||
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
|
|
||||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
|
||||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
|
||||||
golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c=
|
|
||||||
golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
|
||||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
|
||||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
|
||||||
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
|
|
||||||
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
|
|
||||||
golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY=
|
|
||||||
golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds=
|
|
||||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
|
||||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
|
||||||
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
|
|
||||||
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
|
|
||||||
golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE=
|
|
||||||
golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg=
|
|
||||||
golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I=
|
|
||||||
golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY=
|
|
||||||
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
|
|
||||||
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
|
|
||||||
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
|
|
||||||
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
|
|
||||||
golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU=
|
|
||||||
golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY=
|
|
||||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
|
||||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
|
||||||
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
|
||||||
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
|
|
||||||
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
|
||||||
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
|
|
||||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
|
||||||
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
|
|
||||||
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
|
||||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
|
||||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
||||||
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
|
|
||||||
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
||||||
golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ=
|
|
||||||
golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
||||||
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
|
|
||||||
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
||||||
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
|
||||||
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
|
||||||
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
|
||||||
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
|
||||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
|
||||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
|
||||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
|
||||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
|
|
||||||
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
|
|
||||||
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
|
|
||||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
|
|
||||||
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
|
||||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
|
||||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
|
||||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
|
|
||||||
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
|
||||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
|
|
||||||
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
|
||||||
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
|
||||||
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
|
|
||||||
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
|
||||||
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
|
||||||
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
|
||||||
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
|
|
||||||
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
|
||||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
|
||||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
|
golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY=
|
||||||
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
|
golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY=
|
||||||
golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU=
|
|
||||||
golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E=
|
|
||||||
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
|
|
||||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
|
||||||
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
|
|
||||||
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
|
|
||||||
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
|
|
||||||
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
|
|
||||||
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
|
|
||||||
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
|
|
||||||
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
|
|
||||||
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
|
|
||||||
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
|
|
||||||
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
|
|
||||||
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
|
|
||||||
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
|
|
||||||
golang.org/x/term v0.34.0 h1:O/2T7POpk0ZZ7MAzMeWFSg6S5IpWd/RXDlM9hgM3DR4=
|
|
||||||
golang.org/x/term v0.34.0/go.mod h1:5jC53AEywhIVebHgPVeg0mj8OD3VO9OzclacVrqpaAw=
|
|
||||||
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
|
|
||||||
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
|
|
||||||
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
|
|
||||||
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
|
|
||||||
golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU=
|
|
||||||
golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254=
|
|
||||||
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
|
||||||
golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg=
|
|
||||||
golang.org/x/term v0.39.0 h1:RclSuaJf32jOqZz74CkPA9qFuVTX7vhLlpfj/IGWlqY=
|
|
||||||
golang.org/x/term v0.39.0/go.mod h1:yxzUCTP/U+FzoxfdKmLaA0RV1WgE0VY7hXBwKtY/4ww=
|
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
||||||
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
|
golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg=
|
||||||
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164=
|
||||||
golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
|
|
||||||
golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=
|
|
||||||
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
|
|
||||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
|
||||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
|
||||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
|
||||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
|
||||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
|
||||||
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
|
|
||||||
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
|
|
||||||
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
|
|
||||||
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
|
|
||||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
|
||||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
|
||||||
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
|
|
||||||
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
|
|
||||||
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
|
||||||
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
|
||||||
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
|
|
||||||
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
|
|
||||||
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
|
|
||||||
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
|
|
||||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
|
||||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
|
||||||
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
|
||||||
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
|
||||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
|
||||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
|
golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=
|
||||||
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
|
golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=
|
||||||
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
|
|
||||||
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
|
|
||||||
golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ=
|
|
||||||
golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ=
|
|
||||||
golang.org/x/tools v0.40.0 h1:yLkxfA+Qnul4cs9QA3KnlFu0lVmd8JJfoq+E41uSutA=
|
|
||||||
golang.org/x/tools v0.40.0/go.mod h1:Ik/tzLRlbscWpqqMRjyWYDisX8bG13FrdXp3o4Sr9lc=
|
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
|
||||||
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
|
||||||
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
|
|
||||||
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
|
|
||||||
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
|
|
||||||
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
|
|
||||||
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
|
|
||||||
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
|
|
||||||
google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
|
|
||||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
|
||||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
|
||||||
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
|
|
||||||
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
|
||||||
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
|
|
||||||
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
|
||||||
google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw=
|
|
||||||
google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
|
|
||||||
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
|
|
||||||
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
|
||||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw=
|
modernc.org/cc/v4 v4.27.3 h1:uNCgn37E5U09mTv1XgskEVUJ8ADKpmFMPxzGJ0TSo+U=
|
||||||
modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE=
|
modernc.org/cc/v4 v4.27.3/go.mod h1:3YjcbCqhoTTHPycJDRl2WZKKFj0nwcOIPBfEZK0Hdk8=
|
||||||
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
|
modernc.org/ccgo/v4 v4.32.4 h1:L5OB8rpEX4ZsXEQwGozRfJyJSFHbbNVOoQ59DU9/KuU=
|
||||||
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
|
modernc.org/ccgo/v4 v4.32.4/go.mod h1:lY7f+fiTDHfcv6YlRgSkxYfhs+UvOEEzj49jAn2TOx0=
|
||||||
modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E=
|
modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM=
|
||||||
modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E=
|
modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU=
|
||||||
modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ=
|
modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI=
|
||||||
modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0=
|
modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito=
|
||||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo=
|
||||||
|
modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY=
|
||||||
|
modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks=
|
||||||
|
modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI=
|
||||||
|
modernc.org/libc v1.72.0 h1:IEu559v9a0XWjw0DPoVKtXpO2qt5NVLAnFaBbjq+n8c=
|
||||||
|
modernc.org/libc v1.72.0/go.mod h1:tTU8DL8A+XLVkEY3x5E/tO7s2Q/q42EtnNWda/L5QhQ=
|
||||||
|
modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU=
|
||||||
|
modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg=
|
||||||
|
modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI=
|
||||||
|
modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw=
|
||||||
|
modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8=
|
||||||
|
modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns=
|
||||||
|
modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w=
|
||||||
|
modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE=
|
||||||
|
modernc.org/sqlite v1.49.1 h1:dYGHTKcX1sJ+EQDnUzvz4TJ5GbuvhNJa8Fg6ElGx73U=
|
||||||
|
modernc.org/sqlite v1.49.1/go.mod h1:m0w8xhwYUVY3H6pSDwc3gkJ/irZT/0YEXwBlhaxQEew=
|
||||||
|
modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0=
|
||||||
|
modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A=
|
||||||
|
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
|
||||||
|
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.623"
|
const GoextVersion = "0.0.633"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2026-02-03T11:33:03+0100"
|
const GoextVersionTimestamp = "2026-04-13T16:12:09+0200"
|
||||||
|
|||||||
@@ -108,11 +108,11 @@ func (u unmarshalerText) MarshalText() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *unmarshalerText) UnmarshalText(b []byte) error {
|
func (u *unmarshalerText) UnmarshalText(b []byte) error {
|
||||||
pos := bytes.IndexByte(b, ':')
|
before, after, ok := bytes.Cut(b, []byte{':'})
|
||||||
if pos == -1 {
|
if !ok {
|
||||||
return errors.New("missing separator")
|
return errors.New("missing separator")
|
||||||
}
|
}
|
||||||
u.A, u.B = string(b[:pos]), string(b[pos+1:])
|
u.A, u.B = string(before), string(after)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ type ustructText struct {
|
|||||||
type u8marshal uint8
|
type u8marshal uint8
|
||||||
|
|
||||||
func (u8 u8marshal) MarshalText() ([]byte, error) {
|
func (u8 u8marshal) MarshalText() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf("u%d", u8)), nil
|
return fmt.Appendf(nil, "u%d", u8), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var errMissingU8Prefix = errors.New("missing 'u' prefix")
|
var errMissingU8Prefix = errors.New("missing 'u' prefix")
|
||||||
@@ -275,7 +275,7 @@ func (unexportedWithMethods) F() {}
|
|||||||
type byteWithMarshalJSON byte
|
type byteWithMarshalJSON byte
|
||||||
|
|
||||||
func (b byteWithMarshalJSON) MarshalJSON() ([]byte, error) {
|
func (b byteWithMarshalJSON) MarshalJSON() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf(`"Z%.2x"`, byte(b))), nil
|
return fmt.Appendf(nil, `"Z%.2x"`, byte(b)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *byteWithMarshalJSON) UnmarshalJSON(data []byte) error {
|
func (b *byteWithMarshalJSON) UnmarshalJSON(data []byte) error {
|
||||||
@@ -303,7 +303,7 @@ func (b *byteWithPtrMarshalJSON) UnmarshalJSON(data []byte) error {
|
|||||||
type byteWithMarshalText byte
|
type byteWithMarshalText byte
|
||||||
|
|
||||||
func (b byteWithMarshalText) MarshalText() ([]byte, error) {
|
func (b byteWithMarshalText) MarshalText() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf(`Z%.2x`, byte(b))), nil
|
return fmt.Appendf(nil, `Z%.2x`, byte(b)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *byteWithMarshalText) UnmarshalText(data []byte) error {
|
func (b *byteWithMarshalText) UnmarshalText(data []byte) error {
|
||||||
@@ -331,7 +331,7 @@ func (b *byteWithPtrMarshalText) UnmarshalText(data []byte) error {
|
|||||||
type intWithMarshalJSON int
|
type intWithMarshalJSON int
|
||||||
|
|
||||||
func (b intWithMarshalJSON) MarshalJSON() ([]byte, error) {
|
func (b intWithMarshalJSON) MarshalJSON() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf(`"Z%.2x"`, int(b))), nil
|
return fmt.Appendf(nil, `"Z%.2x"`, int(b)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *intWithMarshalJSON) UnmarshalJSON(data []byte) error {
|
func (b *intWithMarshalJSON) UnmarshalJSON(data []byte) error {
|
||||||
@@ -359,7 +359,7 @@ func (b *intWithPtrMarshalJSON) UnmarshalJSON(data []byte) error {
|
|||||||
type intWithMarshalText int
|
type intWithMarshalText int
|
||||||
|
|
||||||
func (b intWithMarshalText) MarshalText() ([]byte, error) {
|
func (b intWithMarshalText) MarshalText() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf(`Z%.2x`, int(b))), nil
|
return fmt.Appendf(nil, `Z%.2x`, int(b)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *intWithMarshalText) UnmarshalText(data []byte) error {
|
func (b *intWithMarshalText) UnmarshalText(data []byte) error {
|
||||||
|
|||||||
+5
-13
@@ -177,7 +177,7 @@ type IndentOpt struct {
|
|||||||
|
|
||||||
// MarshalSafeCollections is like Marshal except it will marshal nil maps and
|
// MarshalSafeCollections is like Marshal except it will marshal nil maps and
|
||||||
// slices as '{}' and '[]' respectfully instead of 'null'
|
// slices as '{}' and '[]' respectfully instead of 'null'
|
||||||
func MarshalSafeCollections(v interface{}, nilSafeSlices bool, nilSafeMaps bool, indent *IndentOpt, filter *string) ([]byte, error) {
|
func MarshalSafeCollections(v any, nilSafeSlices bool, nilSafeMaps bool, indent *IndentOpt, filter *string) ([]byte, error) {
|
||||||
e := &encodeState{}
|
e := &encodeState{}
|
||||||
err := e.marshal(v, encOpts{escapeHTML: true, nilSafeSlices: nilSafeSlices, nilSafeMaps: nilSafeMaps, filter: filter})
|
err := e.marshal(v, encOpts{escapeHTML: true, nilSafeSlices: nilSafeSlices, nilSafeMaps: nilSafeMaps, filter: filter})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -891,7 +891,7 @@ func (se sliceEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
|
|||||||
// Here we use a struct to memorize the pointer to the first element of the slice
|
// Here we use a struct to memorize the pointer to the first element of the slice
|
||||||
// and its length.
|
// and its length.
|
||||||
ptr := struct {
|
ptr := struct {
|
||||||
ptr interface{} // always an unsafe.Pointer, but avoids a dependency on package unsafe
|
ptr any // always an unsafe.Pointer, but avoids a dependency on package unsafe
|
||||||
len int
|
len int
|
||||||
}{v.UnsafePointer(), v.Len()}
|
}{v.UnsafePointer(), v.Len()}
|
||||||
if _, ok := e.ptrSeen[ptr]; ok {
|
if _, ok := e.ptrSeen[ptr]; ok {
|
||||||
@@ -923,7 +923,7 @@ type arrayEncoder struct {
|
|||||||
func (ae arrayEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
|
func (ae arrayEncoder) encode(e *encodeState, v reflect.Value, opts encOpts) {
|
||||||
e.WriteByte('[')
|
e.WriteByte('[')
|
||||||
n := v.Len()
|
n := v.Len()
|
||||||
for i := 0; i < n; i++ {
|
for i := range n {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
e.WriteByte(',')
|
e.WriteByte(',')
|
||||||
}
|
}
|
||||||
@@ -1075,10 +1075,7 @@ func appendString[Bytes []byte | string](dst []byte, src Bytes, escapeHTML bool)
|
|||||||
// For now, cast only a small portion of byte slices to a string
|
// For now, cast only a small portion of byte slices to a string
|
||||||
// so that it can be stack allocated. This slows down []byte slightly
|
// so that it can be stack allocated. This slows down []byte slightly
|
||||||
// due to the extra copy, but keeps string performance roughly the same.
|
// due to the extra copy, but keeps string performance roughly the same.
|
||||||
n := len(src) - i
|
n := min(len(src)-i, utf8.UTFMax)
|
||||||
if n > utf8.UTFMax {
|
|
||||||
n = utf8.UTFMax
|
|
||||||
}
|
|
||||||
c, size := utf8.DecodeRuneInString(string(src[i : i+n]))
|
c, size := utf8.DecodeRuneInString(string(src[i : i+n]))
|
||||||
if c == utf8.RuneError && size == 1 {
|
if c == utf8.RuneError && size == 1 {
|
||||||
dst = append(dst, src[start:i]...)
|
dst = append(dst, src[start:i]...)
|
||||||
@@ -1130,12 +1127,7 @@ type field struct {
|
|||||||
type jsonfilter []string
|
type jsonfilter []string
|
||||||
|
|
||||||
func (j jsonfilter) Contains(t string) bool {
|
func (j jsonfilter) Contains(t string) bool {
|
||||||
for _, tag := range j {
|
return slices.Contains(j, t)
|
||||||
if t == tag {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// typeFields returns a list of fields that JSON should recognize for the given type.
|
// typeFields returns a list of fields that JSON should recognize for the given type.
|
||||||
|
|||||||
+14
-15
@@ -41,7 +41,7 @@ type Optionals struct {
|
|||||||
Uo uint `json:"uo,omitempty"`
|
Uo uint `json:"uo,omitempty"`
|
||||||
|
|
||||||
Str struct{} `json:"str"`
|
Str struct{} `json:"str"`
|
||||||
Sto struct{} `json:"sto,omitempty"`
|
Sto struct{} `json:"sto"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOmitEmpty(t *testing.T) {
|
func TestOmitEmpty(t *testing.T) {
|
||||||
@@ -1166,8 +1166,7 @@ func TestMarshalUncommonFieldNames(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestMarshalerError(t *testing.T) {
|
func TestMarshalerError(t *testing.T) {
|
||||||
s := "test variable"
|
st := reflect.TypeFor[string]()
|
||||||
st := reflect.TypeOf(s)
|
|
||||||
const errText = "json: test error"
|
const errText = "json: test error"
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
@@ -1222,18 +1221,18 @@ func TestIssue63379(t *testing.T) {
|
|||||||
|
|
||||||
func TestMarshalSafeCollections(t *testing.T) {
|
func TestMarshalSafeCollections(t *testing.T) {
|
||||||
var (
|
var (
|
||||||
nilSlice []interface{}
|
nilSlice []any
|
||||||
pNilSlice *[]interface{}
|
pNilSlice *[]any
|
||||||
nilMap map[string]interface{}
|
nilMap map[string]any
|
||||||
pNilMap *map[string]interface{}
|
pNilMap *map[string]any
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
nilSliceStruct struct {
|
nilSliceStruct struct {
|
||||||
NilSlice []interface{} `json:"nil_slice"`
|
NilSlice []any `json:"nil_slice"`
|
||||||
}
|
}
|
||||||
nilMapStruct struct {
|
nilMapStruct struct {
|
||||||
NilMap map[string]interface{} `json:"nil_map"`
|
NilMap map[string]any `json:"nil_map"`
|
||||||
}
|
}
|
||||||
testWithFilter struct {
|
testWithFilter struct {
|
||||||
Test1 string `json:"test1" jsonfilter:"FILTERONE"`
|
Test1 string `json:"test1" jsonfilter:"FILTERONE"`
|
||||||
@@ -1242,19 +1241,19 @@ func TestMarshalSafeCollections(t *testing.T) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
in interface{}
|
in any
|
||||||
want string
|
want string
|
||||||
}{
|
}{
|
||||||
{nilSlice, "[]"},
|
{nilSlice, "[]"},
|
||||||
{[]interface{}{}, "[]"},
|
{[]any{}, "[]"},
|
||||||
{make([]interface{}, 0), "[]"},
|
{make([]any, 0), "[]"},
|
||||||
{[]int{1, 2, 3}, "[1,2,3]"},
|
{[]int{1, 2, 3}, "[1,2,3]"},
|
||||||
{pNilSlice, "null"},
|
{pNilSlice, "null"},
|
||||||
{nilSliceStruct{}, "{\"nil_slice\":[]}"},
|
{nilSliceStruct{}, "{\"nil_slice\":[]}"},
|
||||||
{nilMap, "{}"},
|
{nilMap, "{}"},
|
||||||
{map[string]interface{}{}, "{}"},
|
{map[string]any{}, "{}"},
|
||||||
{make(map[string]interface{}, 0), "{}"},
|
{make(map[string]any, 0), "{}"},
|
||||||
{map[string]interface{}{"1": 1, "2": 2, "3": 3}, "{\"1\":1,\"2\":2,\"3\":3}"},
|
{map[string]any{"1": 1, "2": 2, "3": 3}, "{\"1\":1,\"2\":2,\"3\":3}"},
|
||||||
{pNilMap, "null"},
|
{pNilMap, "null"},
|
||||||
{nilMapStruct{}, "{\"nil_map\":{}}"},
|
{nilMapStruct{}, "{\"nil_map\":{}}"},
|
||||||
{testWithFilter{}, "{\"test1\":\"\"}"},
|
{testWithFilter{}, "{\"test1\":\"\"}"},
|
||||||
|
|||||||
+4
-4
@@ -28,10 +28,10 @@ func FuzzUnmarshalJSON(f *testing.F) {
|
|||||||
}`))
|
}`))
|
||||||
|
|
||||||
f.Fuzz(func(t *testing.T, b []byte) {
|
f.Fuzz(func(t *testing.T, b []byte) {
|
||||||
for _, typ := range []func() interface{}{
|
for _, typ := range []func() any{
|
||||||
func() interface{} { return new(interface{}) },
|
func() any { return new(any) },
|
||||||
func() interface{} { return new(map[string]interface{}) },
|
func() any { return new(map[string]any) },
|
||||||
func() interface{} { return new([]interface{}) },
|
func() any { return new([]any) },
|
||||||
} {
|
} {
|
||||||
i := typ()
|
i := typ()
|
||||||
if err := Unmarshal(b, i); err != nil {
|
if err := Unmarshal(b, i); err != nil {
|
||||||
|
|||||||
+1
-1
@@ -90,7 +90,7 @@ func appendCompact(dst, src []byte, escape bool) ([]byte, error) {
|
|||||||
func appendNewline(dst []byte, prefix, indent string, depth int) []byte {
|
func appendNewline(dst []byte, prefix, indent string, depth int) []byte {
|
||||||
dst = append(dst, '\n')
|
dst = append(dst, '\n')
|
||||||
dst = append(dst, prefix...)
|
dst = append(dst, prefix...)
|
||||||
for i := 0; i < depth; i++ {
|
for range depth {
|
||||||
dst = append(dst, indent...)
|
dst = append(dst, indent...)
|
||||||
}
|
}
|
||||||
return dst
|
return dst
|
||||||
|
|||||||
+3
-12
@@ -210,10 +210,7 @@ func diff(t *testing.T, a, b []byte) {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
for i := 0; ; i++ {
|
for i := 0; ; i++ {
|
||||||
if i >= len(a) || i >= len(b) || a[i] != b[i] {
|
if i >= len(a) || i >= len(b) || a[i] != b[i] {
|
||||||
j := i - 10
|
j := max(i-10, 0)
|
||||||
if j < 0 {
|
|
||||||
j = 0
|
|
||||||
}
|
|
||||||
t.Errorf("diverge at %d: «%s» vs «%s»", i, trim(a[j:]), trim(b[j:]))
|
t.Errorf("diverge at %d: «%s» vs «%s»", i, trim(a[j:]), trim(b[j:]))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -274,10 +271,7 @@ func genString(stddev float64) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func genArray(n int) []any {
|
func genArray(n int) []any {
|
||||||
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
|
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
|
||||||
if f > n {
|
|
||||||
f = n
|
|
||||||
}
|
|
||||||
if f < 1 {
|
if f < 1 {
|
||||||
f = 1
|
f = 1
|
||||||
}
|
}
|
||||||
@@ -289,10 +283,7 @@ func genArray(n int) []any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func genMap(n int) map[string]any {
|
func genMap(n int) map[string]any {
|
||||||
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
|
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
|
||||||
if f > n {
|
|
||||||
f = n
|
|
||||||
}
|
|
||||||
if n > 0 && f == 0 {
|
if n > 0 && f == 0 {
|
||||||
f = 1
|
f = 1
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -83,8 +82,8 @@ func (c *oauth) AccessToken() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c.lock.Lock()
|
c.lock.Lock()
|
||||||
c.expiryDate = langext.Ptr(reqStartTime.Add(timeext.FromSeconds(r.ExpiresIn - 10)))
|
c.expiryDate = new(reqStartTime.Add(timeext.FromSeconds(r.ExpiresIn - 10)))
|
||||||
c.accessToken = langext.Ptr(r.AccessToken)
|
c.accessToken = new(r.AccessToken)
|
||||||
c.lock.Unlock()
|
c.lock.Unlock()
|
||||||
|
|
||||||
return r.AccessToken, nil
|
return r.AccessToken, nil
|
||||||
|
|||||||
+38
-41
@@ -5,6 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"slices"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BoolCount(arr ...bool) int {
|
func BoolCount(arr ...bool) int {
|
||||||
@@ -41,22 +43,12 @@ func ReverseArray[T any](v []T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InArray[T comparable](needle T, haystack []T) bool {
|
func InArray[T comparable](needle T, haystack []T) bool {
|
||||||
for _, v := range haystack {
|
return slices.Contains(haystack, needle)
|
||||||
if v == needle {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ArrContains checks if the value is contained in the array (same as InArray, but odther name for better findability)
|
// ArrContains checks if the value is contained in the array (same as InArray, but odther name for better findability)
|
||||||
func ArrContains[T comparable](haystack []T, needle T) bool {
|
func ArrContains[T comparable](haystack []T, needle T) bool {
|
||||||
for _, v := range haystack {
|
return slices.Contains(haystack, needle)
|
||||||
if v == needle {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArrUnique[T comparable](array []T) []T {
|
func ArrUnique[T comparable](array []T) []T {
|
||||||
@@ -119,12 +111,7 @@ func ArrAllErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ArrNone[T any](arr []T, fn func(T) bool) bool {
|
func ArrNone[T any](arr []T, fn func(T) bool) bool {
|
||||||
for _, av := range arr {
|
return !slices.ContainsFunc(arr, fn)
|
||||||
if fn(av) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArrNoneErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
func ArrNoneErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
||||||
@@ -141,12 +128,7 @@ func ArrNoneErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ArrAny[T any](arr []T, fn func(T) bool) bool {
|
func ArrAny[T any](arr []T, fn func(T) bool) bool {
|
||||||
for _, av := range arr {
|
return slices.ContainsFunc(arr, fn)
|
||||||
if fn(av) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArrAnyErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
func ArrAnyErr[T any](arr []T, fn func(T) (bool, error)) (bool, error) {
|
||||||
@@ -246,7 +228,7 @@ func ArrFirst[T any](arr []T, comp func(v T) bool) (T, bool) {
|
|||||||
func ArrFirstOrNil[T any](arr []T, comp func(v T) bool) *T {
|
func ArrFirstOrNil[T any](arr []T, comp func(v T) bool) *T {
|
||||||
for _, v := range arr {
|
for _, v := range arr {
|
||||||
if comp(v) {
|
if comp(v) {
|
||||||
return Ptr(v)
|
return new(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -274,7 +256,7 @@ func ArrLastOrNil[T any](arr []T, comp func(v T) bool) *T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if found {
|
if found {
|
||||||
return Ptr(result)
|
return new(result)
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -319,10 +301,8 @@ func ArrLastIndexFunc[T any](arr []T, comp func(v T) bool) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AddToSet[T comparable](set []T, add T) []T {
|
func AddToSet[T comparable](set []T, add T) []T {
|
||||||
for _, v := range set {
|
if slices.Contains(set, add) {
|
||||||
if v == add {
|
return set
|
||||||
return set
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return append(set, add)
|
return append(set, add)
|
||||||
}
|
}
|
||||||
@@ -522,7 +502,7 @@ func ArrAppend[T any](arr []T, add ...T) []T {
|
|||||||
func ArrPrepend[T any](arr []T, add ...T) []T {
|
func ArrPrepend[T any](arr []T, add ...T) []T {
|
||||||
out := make([]T, len(arr)+len(add))
|
out := make([]T, len(arr)+len(add))
|
||||||
copy(out[len(add):], arr)
|
copy(out[len(add):], arr)
|
||||||
for i := 0; i < len(add); i++ {
|
for i := range add {
|
||||||
out[len(add)-i-1] = add[i]
|
out[len(add)-i-1] = add[i]
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
@@ -558,8 +538,8 @@ func ArrExcept[T comparable](arr []T, needles ...T) []T {
|
|||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
func ArrayToInterface[T any](t []T) []interface{} {
|
func ArrayToInterface[T any](t []T) []any {
|
||||||
res := make([]interface{}, 0, len(t))
|
res := make([]any, 0, len(t))
|
||||||
for i, _ := range t {
|
for i, _ := range t {
|
||||||
res = append(res, t[i])
|
res = append(res, t[i])
|
||||||
}
|
}
|
||||||
@@ -567,15 +547,15 @@ func ArrayToInterface[T any](t []T) []interface{} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func JoinString(arr []string, delimiter string) string {
|
func JoinString(arr []string, delimiter string) string {
|
||||||
str := ""
|
var str strings.Builder
|
||||||
for i, v := range arr {
|
for i, v := range arr {
|
||||||
str += v
|
str.WriteString(v)
|
||||||
if i < len(arr)-1 {
|
if i < len(arr)-1 {
|
||||||
str += delimiter
|
str.WriteString(delimiter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return str
|
return str.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// ArrChunk splits the array into buckets of max-size `chunkSize`
|
// ArrChunk splits the array into buckets of max-size `chunkSize`
|
||||||
@@ -595,10 +575,7 @@ func ArrChunk[T any](arr []T, chunkSize int) [][]T {
|
|||||||
i := 0
|
i := 0
|
||||||
for i < len(arr) {
|
for i < len(arr) {
|
||||||
|
|
||||||
right := i + chunkSize
|
right := min(i+chunkSize, len(arr))
|
||||||
if right >= len(arr) {
|
|
||||||
right = len(arr)
|
|
||||||
}
|
|
||||||
|
|
||||||
res = append(res, arr[i:right])
|
res = append(res, arr[i:right])
|
||||||
|
|
||||||
@@ -631,3 +608,23 @@ func ArrShuffle[T any](arr []T) []T {
|
|||||||
|
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ArrMax[T NumberConstraint](first T, arr []T) T {
|
||||||
|
res := first
|
||||||
|
for _, v := range arr {
|
||||||
|
if v > res {
|
||||||
|
res = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
func ArrMin[T NumberConstraint](first T, arr []T) T {
|
||||||
|
res := first
|
||||||
|
for _, v := range arr {
|
||||||
|
if v < res {
|
||||||
|
res = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|||||||
+4
-7
@@ -44,8 +44,8 @@ func newBase58Encoding(alphabet string) *B58Encoding {
|
|||||||
|
|
||||||
b58 := make([]byte, 0, 256)
|
b58 := make([]byte, 0, 256)
|
||||||
|
|
||||||
for i := byte(0); i < 32; i++ {
|
for i := range byte(32) {
|
||||||
for j := byte(0); j < 8; j++ {
|
for j := range byte(8) {
|
||||||
|
|
||||||
b := i*8 + j
|
b := i*8 + j
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ func (enc *B58Encoding) Encode(src []byte) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m := mod.Int64()
|
m := mod.Int64()
|
||||||
for i := 0; i < 10; i++ {
|
for range 10 {
|
||||||
answer = append(answer, enc.alphabet[m%58])
|
answer = append(answer, enc.alphabet[m%58])
|
||||||
m /= 58
|
m /= 58
|
||||||
}
|
}
|
||||||
@@ -137,10 +137,7 @@ func (enc *B58Encoding) Decode(src []byte) ([]byte, error) {
|
|||||||
scratch := new(big.Int)
|
scratch := new(big.Int)
|
||||||
|
|
||||||
for t := src; len(t) > 0; {
|
for t := src; len(t) > 0; {
|
||||||
n := len(t)
|
n := min(len(t), 10)
|
||||||
if n > 10 {
|
|
||||||
n = 10
|
|
||||||
}
|
|
||||||
|
|
||||||
total := uint64(0)
|
total := uint64(0)
|
||||||
for _, v := range t[:n] {
|
for _, v := range t[:n] {
|
||||||
|
|||||||
+4
-4
@@ -18,18 +18,18 @@ func RandBase62(rlen int) string {
|
|||||||
|
|
||||||
randMax := big.NewInt(math.MaxInt64)
|
randMax := big.NewInt(math.MaxInt64)
|
||||||
|
|
||||||
r := ""
|
var r strings.Builder
|
||||||
|
|
||||||
for i := 0; i < rlen; i++ {
|
for range rlen {
|
||||||
v, err := rand.Int(rand.Reader, randMax)
|
v, err := rand.Int(rand.Reader, randMax)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r += string(base62CharacterSet[v.Mod(v, bi52).Int64()])
|
r.WriteString(string(base62CharacterSet[v.Mod(v, bi52).Int64()]))
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func EncodeBase62(num uint64) string {
|
func EncodeBase62(num uint64) string {
|
||||||
|
|||||||
+8
-7
@@ -5,6 +5,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AnyBaseConverter struct {
|
type AnyBaseConverter struct {
|
||||||
@@ -25,18 +26,18 @@ func (bc AnyBaseConverter) Rand(rlen int) string {
|
|||||||
|
|
||||||
randMax := big.NewInt(math.MaxInt64)
|
randMax := big.NewInt(math.MaxInt64)
|
||||||
|
|
||||||
r := ""
|
var r strings.Builder
|
||||||
|
|
||||||
for i := 0; i < rlen; i++ {
|
for range rlen {
|
||||||
v, err := rand.Int(rand.Reader, randMax)
|
v, err := rand.Int(rand.Reader, randMax)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
r += string(bc.charset[v.Mod(v, biBase).Int64()])
|
r.WriteString(string(bc.charset[v.Mod(v, biBase).Int64()]))
|
||||||
}
|
}
|
||||||
|
|
||||||
return r
|
return r.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bc AnyBaseConverter) EncodeUInt64(num uint64) string {
|
func (bc AnyBaseConverter) EncodeUInt64(num uint64) string {
|
||||||
@@ -44,7 +45,7 @@ func (bc AnyBaseConverter) EncodeUInt64(num uint64) string {
|
|||||||
return "0"
|
return "0"
|
||||||
}
|
}
|
||||||
|
|
||||||
b := ""
|
var b strings.Builder
|
||||||
|
|
||||||
// loop as long the num is bigger than zero
|
// loop as long the num is bigger than zero
|
||||||
for num > 0 {
|
for num > 0 {
|
||||||
@@ -53,10 +54,10 @@ func (bc AnyBaseConverter) EncodeUInt64(num uint64) string {
|
|||||||
num -= r
|
num -= r
|
||||||
num /= base62Base
|
num /= base62Base
|
||||||
|
|
||||||
b += string(bc.charset[int(r)])
|
b.WriteString(string(bc.charset[int(r)]))
|
||||||
}
|
}
|
||||||
|
|
||||||
return b
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (bc AnyBaseConverter) DecodeUInt64(str string) (uint64, error) {
|
func (bc AnyBaseConverter) DecodeUInt64(str string) (uint64, error) {
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ func BytesXOR(a []byte, b []byte) ([]byte, error) {
|
|||||||
|
|
||||||
r := make([]byte, len(a))
|
r := make([]byte, len(a))
|
||||||
|
|
||||||
for i := 0; i < len(a); i++ {
|
for i := range a {
|
||||||
r[i] = a[i] ^ b[i]
|
r[i] = a[i] ^ b[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -85,7 +85,7 @@ func MarshalJsonOrNil(v any) *string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return Ptr(string(bin))
|
return new(string(bin))
|
||||||
}
|
}
|
||||||
|
|
||||||
func MarshalJsonIndentOrPanic(v any, prefix, indent string) string {
|
func MarshalJsonIndentOrPanic(v any, prefix, indent string) string {
|
||||||
@@ -109,5 +109,5 @@ func MarshalJsonIndentOrNil(v any, prefix, indent string) *string {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return Ptr(string(bin))
|
return new(string(bin))
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-9
@@ -1,5 +1,7 @@
|
|||||||
package langext
|
package langext
|
||||||
|
|
||||||
|
import "maps"
|
||||||
|
|
||||||
import "encoding/json"
|
import "encoding/json"
|
||||||
|
|
||||||
type MapEntry[T comparable, V any] struct {
|
type MapEntry[T comparable, V any] struct {
|
||||||
@@ -60,9 +62,7 @@ func MapToArr[T comparable, V any](v map[T]V) []MapEntry[T, V] {
|
|||||||
|
|
||||||
func CopyMap[K comparable, V any](a map[K]V) map[K]V {
|
func CopyMap[K comparable, V any](a map[K]V) map[K]V {
|
||||||
result := make(map[K]V, len(a))
|
result := make(map[K]V, len(a))
|
||||||
for k, v := range a {
|
maps.Copy(result, a)
|
||||||
result[k] = v
|
|
||||||
}
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,14 +90,10 @@ func ForceJsonMapOrPanic(v any) map[string]any {
|
|||||||
func MapMerge[K comparable, V any](base map[K]V, arr ...map[K]V) map[K]V {
|
func MapMerge[K comparable, V any](base map[K]V, arr ...map[K]V) map[K]V {
|
||||||
res := make(map[K]V, len(base)*(1+len(arr)))
|
res := make(map[K]V, len(base)*(1+len(arr)))
|
||||||
|
|
||||||
for k, v := range base {
|
maps.Copy(res, base)
|
||||||
res[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, m := range arr {
|
for _, m := range arr {
|
||||||
for k, v := range m {
|
maps.Copy(res, m)
|
||||||
res[k] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
+16
-10
@@ -5,16 +5,17 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// PTrue := &true
|
// PTrue := &true
|
||||||
var PTrue = Ptr(true)
|
var PTrue = new(true)
|
||||||
|
|
||||||
// PFalse := &false
|
// PFalse := &false
|
||||||
var PFalse = Ptr(false)
|
var PFalse = new(false)
|
||||||
|
|
||||||
// PNil := &nil
|
// PNil := &nil
|
||||||
var PNil = Ptr[any](nil)
|
var PNil = Ptr[any](nil)
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func Ptr[T any](v T) *T {
|
func Ptr[T any](v T) *T {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func DblPtr[T any](v T) **T {
|
func DblPtr[T any](v T) **T {
|
||||||
@@ -34,32 +35,37 @@ func DblPtrNil[T any]() **T {
|
|||||||
return &v
|
return &v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func ArrPtr[T any](v ...T) *[]T {
|
func ArrPtr[T any](v ...T) *[]T {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func PtrInt32(v int32) *int32 {
|
func PtrInt32(v int32) *int32 {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func PtrInt64(v int64) *int64 {
|
func PtrInt64(v int64) *int64 {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func PtrFloat32(v float32) *float32 {
|
func PtrFloat32(v float32) *float32 {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:fix inline
|
||||||
func PtrFloat64(v float64) *float64 {
|
func PtrFloat64(v float64) *float64 {
|
||||||
return &v
|
return new(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsNil(i interface{}) bool {
|
func IsNil(i any) bool {
|
||||||
if i == nil {
|
if i == nil {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
switch reflect.TypeOf(i).Kind() {
|
switch reflect.TypeOf(i).Kind() {
|
||||||
case reflect.Ptr, reflect.Map, reflect.Chan, reflect.Slice, reflect.Func, reflect.UnsafePointer:
|
case reflect.Pointer, reflect.Map, reflect.Chan, reflect.Slice, reflect.Func, reflect.UnsafePointer:
|
||||||
return reflect.ValueOf(i).IsNil()
|
return reflect.ValueOf(i).IsNil()
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
+4
-6
@@ -1,18 +1,16 @@
|
|||||||
package langext
|
package langext
|
||||||
|
|
||||||
|
import "slices"
|
||||||
|
|
||||||
import "sort"
|
import "sort"
|
||||||
|
|
||||||
func Sort[T OrderedConstraint](arr []T) {
|
func Sort[T OrderedConstraint](arr []T) {
|
||||||
sort.Slice(arr, func(i1, i2 int) bool {
|
slices.Sort(arr)
|
||||||
return arr[i1] < arr[i2]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func AsSorted[T OrderedConstraint](arr []T) []T {
|
func AsSorted[T OrderedConstraint](arr []T) []T {
|
||||||
arr = ArrCopy(arr)
|
arr = ArrCopy(arr)
|
||||||
sort.Slice(arr, func(i1, i2 int) bool {
|
slices.Sort(arr)
|
||||||
return arr[i1] < arr[i2]
|
|
||||||
})
|
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+21
-11
@@ -3,6 +3,7 @@ package langext
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
func StrLimit(val string, maxlen int, suffix string) string {
|
func StrLimit(val string, maxlen int, suffix string) string {
|
||||||
@@ -14,7 +15,7 @@ func StrLimit(val string, maxlen int, suffix string) string {
|
|||||||
|
|
||||||
func StrSplit(val string, sep string, allowEmpty bool) []string {
|
func StrSplit(val string, sep string, allowEmpty bool) []string {
|
||||||
var arr []string
|
var arr []string
|
||||||
for _, k := range strings.Split(val, sep) {
|
for k := range strings.SplitSeq(val, sep) {
|
||||||
if allowEmpty || k != "" {
|
if allowEmpty || k != "" {
|
||||||
arr = append(arr, k)
|
arr = append(arr, k)
|
||||||
}
|
}
|
||||||
@@ -50,7 +51,7 @@ func DeRefStringer(v fmt.Stringer) *string {
|
|||||||
if v == nil {
|
if v == nil {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
return Ptr(v.String())
|
return new(v.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +93,7 @@ func Indent(str string, pad string) string {
|
|||||||
str = str[0 : len(str)-1]
|
str = str[0 : len(str)-1]
|
||||||
}
|
}
|
||||||
r := ""
|
r := ""
|
||||||
for _, v := range strings.Split(str, "\n") {
|
for v := range strings.SplitSeq(str, "\n") {
|
||||||
r += pad + v + "\n"
|
r += pad + v + "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,27 +113,36 @@ func NumToStringOpt[V IntConstraint](v *V, fallback string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func StrRepeat(val string, count int) string {
|
func StrRepeat(val string, count int) string {
|
||||||
r := ""
|
var r strings.Builder
|
||||||
for i := 0; i < count; i++ {
|
for range count {
|
||||||
r += val
|
r.WriteString(val)
|
||||||
}
|
}
|
||||||
return r
|
return r.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func StrWrap(val string, linelen int, seperator string) string {
|
func StrWrap(val string, linelen int, seperator string) string {
|
||||||
res := ""
|
var res strings.Builder
|
||||||
|
|
||||||
for iPos := 0; ; {
|
for iPos := 0; ; {
|
||||||
next := min(iPos+linelen, len(val))
|
next := min(iPos+linelen, len(val))
|
||||||
res += val[iPos:next]
|
res.WriteString(val[iPos:next])
|
||||||
|
|
||||||
iPos = next
|
iPos = next
|
||||||
if iPos >= len(val) {
|
if iPos >= len(val) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
res += seperator
|
res.WriteString(seperator)
|
||||||
}
|
}
|
||||||
|
|
||||||
return res
|
return res.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func StrRemoveControlCharacters(str string) string {
|
||||||
|
return strings.Map(func(r rune) rune {
|
||||||
|
if unicode.IsControl(r) {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
return r
|
||||||
|
}, str)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,3 +150,12 @@ func TestStrWrapBehaviour4(t *testing.T) {
|
|||||||
t.Errorf("Expected %v but got %v", expected, result)
|
t.Errorf("Expected %v but got %v", expected, result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestStrRemoveControlCharacters(t *testing.T) {
|
||||||
|
str := "\rHel\alo\nWorld\t"
|
||||||
|
expected := "HelloWorld"
|
||||||
|
result := StrRemoveControlCharacters(str)
|
||||||
|
if result != expected {
|
||||||
|
t.Errorf("Expected %v but got %v", expected, result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
// This way you can pretty much always write
|
// This way you can pretty much always write
|
||||||
// `options.FindOne().SetProjection(mongoutils.ProjectionFromStruct(...your_model...))`
|
// `options.FindOne().SetProjection(mongoutils.ProjectionFromStruct(...your_model...))`
|
||||||
// to only get the data from mongodb that you will actually use in the later decode step
|
// to only get the data from mongodb that you will actually use in the later decode step
|
||||||
func ProjectionFromStruct(obj interface{}) bson.M {
|
func ProjectionFromStruct(obj any) bson.M {
|
||||||
v := reflect.ValueOf(obj)
|
v := reflect.ValueOf(obj)
|
||||||
t := v.Type()
|
t := v.Type()
|
||||||
|
|
||||||
|
|||||||
+20
-20
@@ -13,39 +13,39 @@ import (
|
|||||||
func CreateGoExtBsonRegistry() *bsoncodec.Registry {
|
func CreateGoExtBsonRegistry() *bsoncodec.Registry {
|
||||||
reg := bson.NewRegistry()
|
reg := bson.NewRegistry()
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.RFC3339Time{}), rfctime.RFC3339Time{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.RFC3339Time](), rfctime.RFC3339Time{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.RFC3339Time{}), rfctime.RFC3339Time{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.RFC3339Time](), rfctime.RFC3339Time{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.RFC3339NanoTime{}), rfctime.RFC3339NanoTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.RFC3339NanoTime](), rfctime.RFC3339NanoTime{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.RFC3339NanoTime{}), rfctime.RFC3339NanoTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.RFC3339NanoTime](), rfctime.RFC3339NanoTime{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.UnixTime{}), rfctime.UnixTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixTime](), rfctime.UnixTime{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.UnixTime{}), rfctime.UnixTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixTime](), rfctime.UnixTime{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.UnixMilliTime{}), rfctime.UnixMilliTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixMilliTime](), rfctime.UnixMilliTime{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.UnixMilliTime{}), rfctime.UnixMilliTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixMilliTime](), rfctime.UnixMilliTime{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.UnixNanoTime{}), rfctime.UnixNanoTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.UnixNanoTime](), rfctime.UnixNanoTime{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.UnixNanoTime{}), rfctime.UnixNanoTime{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.UnixNanoTime](), rfctime.UnixNanoTime{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.Date{}), rfctime.Date{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.Date](), rfctime.Date{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(&rfctime.Date{}), rfctime.Date{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[*rfctime.Date](), rfctime.Date{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(rfctime.SecondsF64(0)), rfctime.SecondsF64(0))
|
reg.RegisterTypeDecoder(reflect.TypeFor[rfctime.SecondsF64](), rfctime.SecondsF64(0))
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(rfctime.SecondsF64(0))), rfctime.SecondsF64(0))
|
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(rfctime.SecondsF64(0))), rfctime.SecondsF64(0))
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(exerr.ErrorCategory{}), exerr.ErrorCategory{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorCategory](), exerr.ErrorCategory{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(exerr.ErrorCategory{})), exerr.ErrorCategory{})
|
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorCategory{})), exerr.ErrorCategory{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(exerr.ErrorSeverity{}), exerr.ErrorSeverity{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorSeverity](), exerr.ErrorSeverity{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(exerr.ErrorSeverity{})), exerr.ErrorSeverity{})
|
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorSeverity{})), exerr.ErrorSeverity{})
|
||||||
|
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(exerr.ErrorType{}), exerr.ErrorType{})
|
reg.RegisterTypeDecoder(reflect.TypeFor[exerr.ErrorType](), exerr.ErrorType{})
|
||||||
reg.RegisterTypeDecoder(reflect.TypeOf(langext.Ptr(exerr.ErrorType{})), exerr.ErrorType{})
|
reg.RegisterTypeDecoder(reflect.TypeOf(new(exerr.ErrorType{})), exerr.ErrorType{})
|
||||||
|
|
||||||
// otherwise we get []primitve.E when unmarshalling into any
|
// otherwise we get []primitve.E when unmarshalling into any
|
||||||
// which will result in {'key': .., 'value': ...}[] json when json-marshalling
|
// which will result in {'key': .., 'value': ...}[] json when json-marshalling
|
||||||
reg.RegisterTypeMapEntry(bson.TypeEmbeddedDocument, reflect.TypeOf(primitive.M{}))
|
reg.RegisterTypeMapEntry(bson.TypeEmbeddedDocument, reflect.TypeFor[primitive.M]())
|
||||||
|
|
||||||
return reg
|
return reg
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-22
@@ -5,23 +5,23 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var reflectBasicTypes = map[reflect.Kind]reflect.Type{
|
var reflectBasicTypes = map[reflect.Kind]reflect.Type{
|
||||||
reflect.Bool: reflect.TypeOf(false),
|
reflect.Bool: reflect.TypeFor[bool](),
|
||||||
reflect.Int: reflect.TypeOf(int(0)),
|
reflect.Int: reflect.TypeFor[int](),
|
||||||
reflect.Int8: reflect.TypeOf(int8(0)),
|
reflect.Int8: reflect.TypeFor[int8](),
|
||||||
reflect.Int16: reflect.TypeOf(int16(0)),
|
reflect.Int16: reflect.TypeFor[int16](),
|
||||||
reflect.Int32: reflect.TypeOf(int32(0)),
|
reflect.Int32: reflect.TypeFor[int32](),
|
||||||
reflect.Int64: reflect.TypeOf(int64(0)),
|
reflect.Int64: reflect.TypeFor[int64](),
|
||||||
reflect.Uint: reflect.TypeOf(uint(0)),
|
reflect.Uint: reflect.TypeFor[uint](),
|
||||||
reflect.Uint8: reflect.TypeOf(uint8(0)),
|
reflect.Uint8: reflect.TypeFor[uint8](),
|
||||||
reflect.Uint16: reflect.TypeOf(uint16(0)),
|
reflect.Uint16: reflect.TypeFor[uint16](),
|
||||||
reflect.Uint32: reflect.TypeOf(uint32(0)),
|
reflect.Uint32: reflect.TypeFor[uint32](),
|
||||||
reflect.Uint64: reflect.TypeOf(uint64(0)),
|
reflect.Uint64: reflect.TypeFor[uint64](),
|
||||||
reflect.Uintptr: reflect.TypeOf(uintptr(0)),
|
reflect.Uintptr: reflect.TypeFor[uintptr](),
|
||||||
reflect.Float32: reflect.TypeOf(float32(0)),
|
reflect.Float32: reflect.TypeFor[float32](),
|
||||||
reflect.Float64: reflect.TypeOf(float64(0)),
|
reflect.Float64: reflect.TypeFor[float64](),
|
||||||
reflect.Complex64: reflect.TypeOf(complex64(0)),
|
reflect.Complex64: reflect.TypeFor[complex64](),
|
||||||
reflect.Complex128: reflect.TypeOf(complex128(0)),
|
reflect.Complex128: reflect.TypeFor[complex128](),
|
||||||
reflect.String: reflect.TypeOf(""),
|
reflect.String: reflect.TypeFor[string](),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Underlying returns the underlying type of t (without type alias)
|
// Underlying returns the underlying type of t (without type alias)
|
||||||
@@ -48,17 +48,17 @@ func Underlying(t reflect.Type) (ret reflect.Type) {
|
|||||||
nOut := t.NumOut()
|
nOut := t.NumOut()
|
||||||
in := make([]reflect.Type, nIn)
|
in := make([]reflect.Type, nIn)
|
||||||
out := make([]reflect.Type, nOut)
|
out := make([]reflect.Type, nOut)
|
||||||
for i := 0; i < nIn; i++ {
|
for i := range nIn {
|
||||||
in[i] = t.In(i)
|
in[i] = t.In(i)
|
||||||
}
|
}
|
||||||
for i := 0; i < nOut; i++ {
|
for i := range nOut {
|
||||||
out[i] = t.Out(i)
|
out[i] = t.Out(i)
|
||||||
}
|
}
|
||||||
ret = reflect.FuncOf(in, out, t.IsVariadic())
|
ret = reflect.FuncOf(in, out, t.IsVariadic())
|
||||||
case reflect.Interface:
|
case reflect.Interface:
|
||||||
// not supported
|
// not supported
|
||||||
case reflect.Ptr:
|
case reflect.Pointer:
|
||||||
ret = reflect.PtrTo(t.Elem())
|
ret = reflect.PointerTo(t.Elem())
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
ret = reflect.SliceOf(t.Elem())
|
ret = reflect.SliceOf(t.Elem())
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
@@ -72,7 +72,7 @@ func Underlying(t reflect.Type) (ret reflect.Type) {
|
|||||||
}()
|
}()
|
||||||
n := t.NumField()
|
n := t.NumField()
|
||||||
fields := make([]reflect.StructField, n)
|
fields := make([]reflect.StructField, n)
|
||||||
for i := 0; i < n; i++ {
|
for i := range n {
|
||||||
fields[i] = t.Field(i)
|
fields[i] = t.Field(i)
|
||||||
}
|
}
|
||||||
ret = reflect.StructOf(fields)
|
ret = reflect.StructOf(fields)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func reflectToMap(fv reflect.Value, depth int, opt ConvertStructToMapOpt) any {
|
|||||||
return fv.Interface()
|
return fv.Interface()
|
||||||
}
|
}
|
||||||
|
|
||||||
if fv.Kind() == reflect.Ptr {
|
if fv.Kind() == reflect.Pointer {
|
||||||
|
|
||||||
if fv.IsNil() {
|
if fv.IsNil() {
|
||||||
return nil
|
return nil
|
||||||
@@ -57,7 +57,7 @@ func reflectToMap(fv reflect.Value, depth int, opt ConvertStructToMapOpt) any {
|
|||||||
|
|
||||||
arrlen := fv.Len()
|
arrlen := fv.Len()
|
||||||
arr := make([]any, arrlen)
|
arr := make([]any, arrlen)
|
||||||
for i := 0; i < arrlen; i++ {
|
for i := range arrlen {
|
||||||
arr[i] = reflectToMap(fv.Index(i), depth+1, opt)
|
arr[i] = reflectToMap(fv.Index(i), depth+1, opt)
|
||||||
}
|
}
|
||||||
return arr
|
return arr
|
||||||
@@ -68,7 +68,7 @@ func reflectToMap(fv reflect.Value, depth int, opt ConvertStructToMapOpt) any {
|
|||||||
|
|
||||||
arrlen := fv.Len()
|
arrlen := fv.Len()
|
||||||
arr := make([]any, arrlen)
|
arr := make([]any, arrlen)
|
||||||
for i := 0; i < arrlen; i++ {
|
for i := range arrlen {
|
||||||
arr[i] = reflectToMap(fv.Index(i), depth+1, opt)
|
arr[i] = reflectToMap(fv.Index(i), depth+1, opt)
|
||||||
}
|
}
|
||||||
return arr
|
return arr
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func TestConvertStructToMap(t *testing.T) {
|
|||||||
FieldD: []float64{1, 2, 3, 4, 5, 6, 7},
|
FieldD: []float64{1, 2, 3, 4, 5, 6, 7},
|
||||||
FieldE1: nil,
|
FieldE1: nil,
|
||||||
FieldE2: nil,
|
FieldE2: nil,
|
||||||
FieldE3: langext.Ptr(12),
|
FieldE3: new(12),
|
||||||
FieldE4: langext.DblPtr(12),
|
FieldE4: langext.DblPtr(12),
|
||||||
FieldE5: nil,
|
FieldE5: nil,
|
||||||
FieldE6: langext.DblPtrNil[int](),
|
FieldE6: langext.DblPtrNil[int](),
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ func GetMapField[TData any, TKey comparable](mapval any, key TKey) (TData, bool)
|
|||||||
|
|
||||||
rval := reflect.ValueOf(mapval)
|
rval := reflect.ValueOf(mapval)
|
||||||
|
|
||||||
for rval.Kind() == reflect.Ptr && !rval.IsNil() {
|
for rval.Kind() == reflect.Pointer && !rval.IsNil() {
|
||||||
rval = rval.Elem()
|
rval = rval.Elem()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ func GetMapField[TData any, TKey comparable](mapval any, key TKey) (TData, bool)
|
|||||||
return *new(TData), false // key does not exist in mapval
|
return *new(TData), false // key does not exist in mapval
|
||||||
}
|
}
|
||||||
|
|
||||||
destType := reflect.TypeOf(new(TData)).Elem()
|
destType := reflect.TypeFor[TData]()
|
||||||
|
|
||||||
if eval.Type() == destType {
|
if eval.Type() == destType {
|
||||||
return eval.Interface().(TData), true
|
return eval.Interface().(TData), true
|
||||||
@@ -68,11 +68,11 @@ func GetMapField[TData any, TKey comparable](mapval any, key TKey) (TData, bool)
|
|||||||
return eval.Convert(destType).Interface().(TData), true
|
return eval.Convert(destType).Interface().(TData), true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eval.Kind() == reflect.Ptr || eval.Kind() == reflect.Interface) && eval.IsNil() && destType.Kind() == reflect.Ptr {
|
if (eval.Kind() == reflect.Pointer || eval.Kind() == reflect.Interface) && eval.IsNil() && destType.Kind() == reflect.Pointer {
|
||||||
return *new(TData), false // special case: mapval[key] is nil
|
return *new(TData), false // special case: mapval[key] is nil
|
||||||
}
|
}
|
||||||
|
|
||||||
for (eval.Kind() == reflect.Ptr || eval.Kind() == reflect.Interface) && !eval.IsNil() {
|
for (eval.Kind() == reflect.Pointer || eval.Kind() == reflect.Interface) && !eval.IsNil() {
|
||||||
eval = eval.Elem()
|
eval = eval.Elem()
|
||||||
|
|
||||||
if eval.Type() == destType {
|
if eval.Type() == destType {
|
||||||
|
|||||||
+13
-13
@@ -3,8 +3,8 @@ package reflectext
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -13,24 +13,24 @@ import (
|
|||||||
|
|
||||||
var primitiveSerializer = map[reflect.Type]genSerializer{
|
var primitiveSerializer = map[reflect.Type]genSerializer{
|
||||||
|
|
||||||
reflect.TypeOf(""): newGenSerializer(serStringToString, serStringToString),
|
reflect.TypeFor[string](): newGenSerializer(serStringToString, serStringToString),
|
||||||
|
|
||||||
reflect.TypeOf(int(0)): newGenSerializer(serIntNumToString[int], serStringToSIntNum[int]),
|
reflect.TypeFor[int](): newGenSerializer(serIntNumToString[int], serStringToSIntNum[int]),
|
||||||
reflect.TypeOf(int32(0)): newGenSerializer(serIntNumToString[int32], serStringToSIntNum[int32]),
|
reflect.TypeFor[int32](): newGenSerializer(serIntNumToString[int32], serStringToSIntNum[int32]),
|
||||||
reflect.TypeOf(int64(0)): newGenSerializer(serIntNumToString[int64], serStringToSIntNum[int64]),
|
reflect.TypeFor[int64](): newGenSerializer(serIntNumToString[int64], serStringToSIntNum[int64]),
|
||||||
|
|
||||||
reflect.TypeOf(uint(0)): newGenSerializer(serIntNumToString[uint], serStringToUIntNum[uint]),
|
reflect.TypeFor[uint](): newGenSerializer(serIntNumToString[uint], serStringToUIntNum[uint]),
|
||||||
reflect.TypeOf(uint32(0)): newGenSerializer(serIntNumToString[uint32], serStringToUIntNum[uint32]),
|
reflect.TypeFor[uint32](): newGenSerializer(serIntNumToString[uint32], serStringToUIntNum[uint32]),
|
||||||
reflect.TypeOf(uint64(0)): newGenSerializer(serIntNumToString[uint64], serStringToUIntNum[uint64]),
|
reflect.TypeFor[uint64](): newGenSerializer(serIntNumToString[uint64], serStringToUIntNum[uint64]),
|
||||||
|
|
||||||
reflect.TypeOf(float32(0)): newGenSerializer(serFloatNumToString[float32], serStringToFloatNum[float32]),
|
reflect.TypeFor[float32](): newGenSerializer(serFloatNumToString[float32], serStringToFloatNum[float32]),
|
||||||
reflect.TypeOf(float64(0)): newGenSerializer(serFloatNumToString[float64], serStringToFloatNum[float64]),
|
reflect.TypeFor[float64](): newGenSerializer(serFloatNumToString[float64], serStringToFloatNum[float64]),
|
||||||
|
|
||||||
reflect.TypeOf(true): newGenSerializer(serBoolToString, serStringToBool),
|
reflect.TypeFor[bool](): newGenSerializer(serBoolToString, serStringToBool),
|
||||||
|
|
||||||
reflect.TypeOf(primitive.ObjectID{}): newGenSerializer(serObjectIDToString, serStringToObjectID),
|
reflect.TypeFor[primitive.ObjectID](): newGenSerializer(serObjectIDToString, serStringToObjectID),
|
||||||
|
|
||||||
reflect.TypeOf(time.Time{}): newGenSerializer(serTimeToString, serStringToTime),
|
reflect.TypeFor[time.Time](): newGenSerializer(serTimeToString, serStringToTime),
|
||||||
}
|
}
|
||||||
|
|
||||||
type genSerializer struct {
|
type genSerializer struct {
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ func (pss PrimitiveStringSerializer) ValueToString(v any) (string, error) {
|
|||||||
|
|
||||||
inType := reflect.TypeOf(v)
|
inType := reflect.TypeOf(v)
|
||||||
|
|
||||||
if inType.Kind() == reflect.Ptr && langext.IsNil(v) {
|
if inType.Kind() == reflect.Pointer && langext.IsNil(v) {
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if inType.Kind() == reflect.Ptr {
|
if inType.Kind() == reflect.Pointer {
|
||||||
rval1 := reflect.ValueOf(v)
|
rval1 := reflect.ValueOf(v)
|
||||||
rval2 := rval1.Elem()
|
rval2 := rval1.Elem()
|
||||||
rval3 := rval2.Interface()
|
rval3 := rval2.Interface()
|
||||||
@@ -46,7 +46,7 @@ func (pss PrimitiveStringSerializer) ValueToString(v any) (string, error) {
|
|||||||
|
|
||||||
func (pss PrimitiveStringSerializer) ValueFromString(str string, outType reflect.Type) (any, error) {
|
func (pss PrimitiveStringSerializer) ValueFromString(str string, outType reflect.Type) (any, error) {
|
||||||
|
|
||||||
if outType.Kind() == reflect.Ptr && str == "" {
|
if outType.Kind() == reflect.Pointer && str == "" {
|
||||||
return reflect.Zero(outType).Interface(), nil // = nil.(outType), nil
|
return reflect.Zero(outType).Interface(), nil // = nil.(outType), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ func (pss PrimitiveStringSerializer) ValueFromString(str string, outType reflect
|
|||||||
return reflect.Zero(outType).Interface(), nil // = <default>(outType), nil
|
return reflect.Zero(outType).Interface(), nil // = <default>(outType), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if outType.Kind() == reflect.Ptr {
|
if outType.Kind() == reflect.Pointer {
|
||||||
|
|
||||||
innerValue, err := pss.ValueFromString(str, outType.Elem())
|
innerValue, err := pss.ValueFromString(str, outType.Elem())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package reflectext
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -29,7 +28,7 @@ type AccessStructOpt struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func AccessJSONStruct[TResult any](v any, path string) (TResult, error) {
|
func AccessJSONStruct[TResult any](v any, path string) (TResult, error) {
|
||||||
return AccessStructByStringPath[TResult](v, path, AccessStructOpt{UsedTagForKeys: langext.Ptr("json")})
|
return AccessStructByStringPath[TResult](v, path, AccessStructOpt{UsedTagForKeys: new("json")})
|
||||||
}
|
}
|
||||||
|
|
||||||
func AccessStruct[TResult any](v any, path string) (TResult, error) {
|
func AccessStruct[TResult any](v any, path string) (TResult, error) {
|
||||||
@@ -84,7 +83,7 @@ func accessStructByPath(val reflect.Value, path []string, opt AccessStructOpt) (
|
|||||||
|
|
||||||
currPath := path[0]
|
currPath := path[0]
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
if val.IsNil() {
|
if val.IsNil() {
|
||||||
if opt.ReturnNilOnNilPtrFields {
|
if opt.ReturnNilOnNilPtrFields {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
package rext
|
package rext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -170,7 +169,7 @@ func (g OptRegexMatchGroup) ValueOrNil() *string {
|
|||||||
if g.v == nil {
|
if g.v == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(g.v.Value())
|
return new(g.v.Value())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g OptRegexMatchGroup) IsEmpty() bool {
|
func (g OptRegexMatchGroup) IsEmpty() bool {
|
||||||
|
|||||||
+3
-3
@@ -128,7 +128,7 @@ func (t Date) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t Date) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t Date) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -140,7 +140,7 @@ func (t Date) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ func (t Date) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
|
|||||||
+4
-5
@@ -7,7 +7,6 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
@@ -96,7 +95,7 @@ func (t RFC3339Time) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -108,7 +107,7 @@ func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRead
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -118,7 +117,7 @@ func (t RFC3339Time) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRead
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
@@ -258,7 +257,7 @@ func NewRFC3339Ptr(t *time.Time) *RFC3339Time {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(RFC3339Time(*t))
|
return new(RFC3339Time(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func NowRFC3339() RFC3339Time {
|
func NowRFC3339() RFC3339Time {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
@@ -95,7 +94,7 @@ func (t RFC3339NanoTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t RFC3339NanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t RFC3339NanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -107,7 +106,7 @@ func (t RFC3339NanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.Value
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -117,7 +116,7 @@ func (t RFC3339NanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.Value
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
@@ -257,7 +256,7 @@ func NewRFC3339NanoPtr(t *time.Time) *RFC3339NanoTime {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(RFC3339NanoTime(*t))
|
return new(RFC3339NanoTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func NowRFC3339Nano() RFC3339NanoTime {
|
func NowRFC3339Nano() RFC3339NanoTime {
|
||||||
|
|||||||
+3
-3
@@ -87,7 +87,7 @@ func (d SecondsF64) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d SecondsF64) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (d SecondsF64) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ func (d SecondsF64) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReade
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ func (d SecondsF64) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReade
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&d))
|
val.Set(reflect.ValueOf(&d))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(d))
|
val.Set(reflect.ValueOf(d))
|
||||||
|
|||||||
+4
-5
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
@@ -93,7 +92,7 @@ func (t UnixTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t UnixTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t UnixTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -105,7 +104,7 @@ func (t UnixTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -115,7 +114,7 @@ func (t UnixTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
@@ -251,7 +250,7 @@ func NewUnixPtr(t *time.Time) *UnixTime {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(UnixTime(*t))
|
return new(UnixTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func NowUnix() UnixTime {
|
func NowUnix() UnixTime {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
@@ -93,7 +92,7 @@ func (t UnixMilliTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t UnixMilliTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t UnixMilliTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -105,7 +104,7 @@ func (t UnixMilliTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -115,7 +114,7 @@ func (t UnixMilliTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRe
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
@@ -251,7 +250,7 @@ func NewUnixMilliPtr(t *time.Time) *UnixMilliTime {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(UnixMilliTime(*t))
|
return new(UnixMilliTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func NowUnixMilli() UnixMilliTime {
|
func NowUnixMilli() UnixMilliTime {
|
||||||
|
|||||||
+4
-5
@@ -4,7 +4,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
"go.mongodb.org/mongo-driver/bson/bsoncodec"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
"go.mongodb.org/mongo-driver/bson/bsonrw"
|
||||||
@@ -93,7 +92,7 @@ func (t UnixNanoTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t UnixNanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
func (t UnixNanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
|
||||||
if val.Kind() == reflect.Ptr && val.IsNil() {
|
if val.Kind() == reflect.Pointer && val.IsNil() {
|
||||||
if !val.CanSet() {
|
if !val.CanSet() {
|
||||||
return errors.New("ValueUnmarshalerDecodeValue")
|
return errors.New("ValueUnmarshalerDecodeValue")
|
||||||
}
|
}
|
||||||
@@ -105,7 +104,7 @@ func (t UnixNanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRea
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr && len(src) == 0 {
|
if val.Kind() == reflect.Pointer && len(src) == 0 {
|
||||||
val.Set(reflect.Zero(val.Type()))
|
val.Set(reflect.Zero(val.Type()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -115,7 +114,7 @@ func (t UnixNanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueRea
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if val.Kind() == reflect.Ptr {
|
if val.Kind() == reflect.Pointer {
|
||||||
val.Set(reflect.ValueOf(&t))
|
val.Set(reflect.ValueOf(&t))
|
||||||
} else {
|
} else {
|
||||||
val.Set(reflect.ValueOf(t))
|
val.Set(reflect.ValueOf(t))
|
||||||
@@ -251,7 +250,7 @@ func NewUnixNanoPtr(t *time.Time) *UnixNanoTime {
|
|||||||
if t == nil {
|
if t == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return langext.Ptr(UnixNanoTime(*t))
|
return new(UnixNanoTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
func NowUnixNano() UnixNanoTime {
|
func NowUnixNano() UnixNanoTime {
|
||||||
|
|||||||
+5
-5
@@ -43,7 +43,7 @@ func BuildUpdateStatement[TData any](q Queryable, tableName string, obj TData, i
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if rsfield.Type.Kind() == reflect.Ptr && rvfield.IsNil() {
|
if rsfield.Type.Kind() == reflect.Pointer && rvfield.IsNil() {
|
||||||
|
|
||||||
setClauses = append(setClauses, fmt.Sprintf("%s = NULL", columnName))
|
setClauses = append(setClauses, fmt.Sprintf("%s = NULL", columnName))
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ func BuildInsertStatement[TData any](q Queryable, tableName string, obj TData) (
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if rsfield.Type.Kind() == reflect.Ptr && rvfield.IsNil() {
|
if rsfield.Type.Kind() == reflect.Pointer && rvfield.IsNil() {
|
||||||
|
|
||||||
fields = append(fields, columnName)
|
fields = append(fields, columnName)
|
||||||
values = append(values, "NULL")
|
values = append(values, "NULL")
|
||||||
@@ -132,8 +132,8 @@ func BuildInsertMultipleStatement[TData any](q Queryable, tableName string, vArr
|
|||||||
{
|
{
|
||||||
columns := make([]string, 0)
|
columns := make([]string, 0)
|
||||||
|
|
||||||
for i := 0; i < rtyp.NumField(); i++ {
|
for rsfield := range rtyp.Fields() {
|
||||||
rsfield := rtyp.Field(i)
|
rsfield := rsfield
|
||||||
|
|
||||||
if !rsfield.IsExported() {
|
if !rsfield.IsExported() {
|
||||||
continue
|
continue
|
||||||
@@ -174,7 +174,7 @@ func BuildInsertMultipleStatement[TData any](q Queryable, tableName string, vArr
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if rsfield.Type.Kind() == reflect.Ptr && rvfield.IsNil() {
|
if rsfield.Type.Kind() == reflect.Pointer && rvfield.IsNil() {
|
||||||
|
|
||||||
params = append(params, "NULL")
|
params = append(params, "NULL")
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ func fnTrimComments(ctx context.Context, cmdtype string, id *uint16, sql *string
|
|||||||
|
|
||||||
res := make([]string, 0)
|
res := make([]string, 0)
|
||||||
|
|
||||||
for _, s := range strings.Split(*sql, "\n") {
|
for s := range strings.SplitSeq(*sql, "\n") {
|
||||||
if strings.HasPrefix(strings.TrimSpace(s), "--") {
|
if strings.HasPrefix(strings.TrimSpace(s), "--") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@ func convertValueToDB(q Queryable, value any) (any, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if value != nil && reflect.TypeOf(value).Kind() == reflect.Ptr {
|
if value != nil && reflect.TypeOf(value).Kind() == reflect.Pointer {
|
||||||
vof := reflect.ValueOf(value)
|
vof := reflect.ValueOf(value)
|
||||||
if vof.IsNil() {
|
if vof.IsNil() {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
|||||||
+8
-8
@@ -6,8 +6,8 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/jmoiron/sqlx"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"github.com/jmoiron/sqlx"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -186,14 +186,14 @@ func CreateSqliteDatabaseSchemaString(ctx context.Context, db Queryable) (string
|
|||||||
result = append(result, tableList[i])
|
result = append(result, tableList[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult := ""
|
var strBuilderResult strings.Builder
|
||||||
for _, vTab := range result {
|
for _, vTab := range result {
|
||||||
jbinTable, err := json.Marshal(vTab)
|
jbinTable, err := json.Marshal(vTab)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult += fmt.Sprintf("#TABLE: %s\n{\n", string(jbinTable))
|
strBuilderResult.WriteString(fmt.Sprintf("#TABLE: %s\n{\n", string(jbinTable)))
|
||||||
|
|
||||||
for _, vCol := range vTab.ColumnInfo {
|
for _, vCol := range vTab.ColumnInfo {
|
||||||
jbinColumn, err := json.Marshal(vCol)
|
jbinColumn, err := json.Marshal(vCol)
|
||||||
@@ -201,7 +201,7 @@ func CreateSqliteDatabaseSchemaString(ctx context.Context, db Queryable) (string
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult += fmt.Sprintf(" COLUMN: %s\n", string(jbinColumn))
|
strBuilderResult.WriteString(fmt.Sprintf(" COLUMN: %s\n", string(jbinColumn)))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, vIdx := range vTab.IndexInfo {
|
for _, vIdx := range vTab.IndexInfo {
|
||||||
@@ -210,7 +210,7 @@ func CreateSqliteDatabaseSchemaString(ctx context.Context, db Queryable) (string
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult += fmt.Sprintf(" INDEX: %s\n", string(jbinIndex))
|
strBuilderResult.WriteString(fmt.Sprintf(" INDEX: %s\n", string(jbinIndex)))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, vFky := range vTab.FKeyInfo {
|
for _, vFky := range vTab.FKeyInfo {
|
||||||
@@ -219,11 +219,11 @@ func CreateSqliteDatabaseSchemaString(ctx context.Context, db Queryable) (string
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult += fmt.Sprintf(" FKEY: %s\n", string(jbinFKey))
|
strBuilderResult.WriteString(fmt.Sprintf(" FKEY: %s\n", string(jbinFKey)))
|
||||||
}
|
}
|
||||||
|
|
||||||
strBuilderResult += "}\n\n"
|
strBuilderResult.WriteString("}\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
return strBuilderResult, nil
|
return strBuilderResult.String(), nil
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Iterate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int, consumer func(ctx context.Context, v TData) error) (int, error) {
|
func Iterate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int, consumer func(ctx context.Context, v TData) error) (int, error) {
|
||||||
@@ -32,12 +33,13 @@ func Iterate[TData any](ctx context.Context, q Queryable, table string, filter P
|
|||||||
|
|
||||||
filterCond, joinCond, joinTables := filter.SQL(prepParams)
|
filterCond, joinCond, joinTables := filter.SQL(prepParams)
|
||||||
|
|
||||||
selectCond := table + ".*"
|
var selectCond strings.Builder
|
||||||
|
selectCond.WriteString(table + ".*")
|
||||||
for _, v := range joinTables {
|
for _, v := range joinTables {
|
||||||
selectCond += ", " + v + ".*"
|
selectCond.WriteString(", " + v + ".*")
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlQueryData := "SELECT " + selectCond + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) " + sortCond + " " + pageCond
|
sqlQueryData := "SELECT " + selectCond.String() + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) " + sortCond + " " + pageCond
|
||||||
|
|
||||||
rows, err := q.Query(ctx, sqlQueryData, prepParams)
|
rows, err := q.Query(ctx, sqlQueryData, prepParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+5
-3
@@ -6,6 +6,7 @@ import (
|
|||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
pag "git.blackforestbytes.com/BlackForestBytes/goext/pagination"
|
pag "git.blackforestbytes.com/BlackForestBytes/goext/pagination"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Paginate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int) ([]TData, pag.Pagination, error) {
|
func Paginate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int) ([]TData, pag.Pagination, error) {
|
||||||
@@ -34,12 +35,13 @@ func Paginate[TData any](ctx context.Context, q Queryable, table string, filter
|
|||||||
|
|
||||||
filterCond, joinCond, joinTables := filter.SQL(prepParams)
|
filterCond, joinCond, joinTables := filter.SQL(prepParams)
|
||||||
|
|
||||||
selectCond := table + ".*"
|
var selectCond strings.Builder
|
||||||
|
selectCond.WriteString(table + ".*")
|
||||||
for _, v := range joinTables {
|
for _, v := range joinTables {
|
||||||
selectCond += ", " + v + ".*"
|
selectCond.WriteString(", " + v + ".*")
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlQueryData := "SELECT " + selectCond + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) " + sortCond + " " + pageCond
|
sqlQueryData := "SELECT " + selectCond.String() + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) " + sortCond + " " + pageCond
|
||||||
sqlQueryCount := "SELECT " + "COUNT(*)" + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) "
|
sqlQueryCount := "SELECT " + "COUNT(*)" + " FROM " + table + " " + joinCond + " WHERE ( " + filterCond + " ) "
|
||||||
|
|
||||||
rows, err := q.Query(ctx, sqlQueryData, prepParams)
|
rows, err := q.Query(ctx, sqlQueryData, prepParams)
|
||||||
|
|||||||
+4
-6
@@ -1,5 +1,7 @@
|
|||||||
package sq
|
package sq
|
||||||
|
|
||||||
|
import "maps"
|
||||||
|
|
||||||
import "git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
import "git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
|
||||||
type PP map[string]any
|
type PP map[string]any
|
||||||
@@ -7,9 +9,7 @@ type PP map[string]any
|
|||||||
func Join(pps ...PP) PP {
|
func Join(pps ...PP) PP {
|
||||||
r := PP{}
|
r := PP{}
|
||||||
for _, add := range pps {
|
for _, add := range pps {
|
||||||
for k, v := range add {
|
maps.Copy(r, add)
|
||||||
r[k] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
@@ -21,9 +21,7 @@ func (pp *PP) Add(v any) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pp *PP) AddAll(other PP) {
|
func (pp *PP) AddAll(other PP) {
|
||||||
for id, v := range other {
|
maps.Copy((*pp), other)
|
||||||
(*pp)[id] = v
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func PPID() string {
|
func PPID() string {
|
||||||
|
|||||||
+9
-9
@@ -3,9 +3,9 @@ package sq
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/jmoiron/sqlx/reflectx"
|
"github.com/jmoiron/sqlx/reflectx"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -39,7 +39,7 @@ type ssConverter struct {
|
|||||||
func (r *StructScanner) Start(dest any) error {
|
func (r *StructScanner) Start(dest any) error {
|
||||||
v := reflect.ValueOf(dest)
|
v := reflect.ValueOf(dest)
|
||||||
|
|
||||||
if v.Kind() != reflect.Ptr {
|
if v.Kind() != reflect.Pointer {
|
||||||
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ func (r *StructScanner) Start(dest any) error {
|
|||||||
if f, err := missingFields(r.fields); err != nil && !r.unsafe {
|
if f, err := missingFields(r.fields); err != nil && !r.unsafe {
|
||||||
return fmt.Errorf("missing destination name %s in %T", columns[f], dest)
|
return fmt.Errorf("missing destination name %s in %T", columns[f], dest)
|
||||||
}
|
}
|
||||||
r.values = make([]interface{}, len(columns))
|
r.values = make([]any, len(columns))
|
||||||
r.converter = make([]ssConverter, len(columns))
|
r.converter = make([]ssConverter, len(columns))
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -66,7 +66,7 @@ func (r *StructScanner) Start(dest any) error {
|
|||||||
func (r *StructScanner) StructScanExt(q Queryable, dest any) error {
|
func (r *StructScanner) StructScanExt(q Queryable, dest any) error {
|
||||||
v := reflect.ValueOf(dest)
|
v := reflect.ValueOf(dest)
|
||||||
|
|
||||||
if v.Kind() != reflect.Ptr {
|
if v.Kind() != reflect.Pointer {
|
||||||
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ func (r *StructScanner) StructScanExt(q Queryable, dest any) error {
|
|||||||
func (r *StructScanner) StructScanBase(dest any) error {
|
func (r *StructScanner) StructScanBase(dest any) error {
|
||||||
v := reflect.ValueOf(dest)
|
v := reflect.ValueOf(dest)
|
||||||
|
|
||||||
if v.Kind() != reflect.Ptr {
|
if v.Kind() != reflect.Pointer {
|
||||||
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
return errors.New("must pass a pointer, not a value, to StructScan destination")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ func (r *StructScanner) StructScanBase(dest any) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fieldsByTraversal forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go
|
// fieldsByTraversal forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go
|
||||||
func fieldsByTraversalExtended(q Queryable, v reflect.Value, traversals [][]int, values []interface{}, converter []ssConverter) error {
|
func fieldsByTraversalExtended(q Queryable, v reflect.Value, traversals [][]int, values []any, converter []ssConverter) error {
|
||||||
v = reflect.Indirect(v)
|
v = reflect.Indirect(v)
|
||||||
if v.Kind() != reflect.Struct {
|
if v.Kind() != reflect.Struct {
|
||||||
return errors.New("argument not a struct")
|
return errors.New("argument not a struct")
|
||||||
@@ -204,7 +204,7 @@ func fieldsByTraversalExtended(q Queryable, v reflect.Value, traversals [][]int,
|
|||||||
|
|
||||||
for i, traversal := range traversals {
|
for i, traversal := range traversals {
|
||||||
if len(traversal) == 0 {
|
if len(traversal) == 0 {
|
||||||
values[i] = new(interface{})
|
values[i] = new(any)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
f := reflectx.FieldByIndexes(v, traversal)
|
f := reflectx.FieldByIndexes(v, traversal)
|
||||||
@@ -243,7 +243,7 @@ func fieldsByTraversalExtended(q Queryable, v reflect.Value, traversals [][]int,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fieldsByTraversal forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go
|
// fieldsByTraversal forked from github.com/jmoiron/sqlx@v1.3.5/sqlx.go
|
||||||
func fieldsByTraversalBase(v reflect.Value, traversals [][]int, values []interface{}, ptrs bool) error {
|
func fieldsByTraversalBase(v reflect.Value, traversals [][]int, values []any, ptrs bool) error {
|
||||||
v = reflect.Indirect(v)
|
v = reflect.Indirect(v)
|
||||||
if v.Kind() != reflect.Struct {
|
if v.Kind() != reflect.Struct {
|
||||||
return errors.New("argument not a struct")
|
return errors.New("argument not a struct")
|
||||||
@@ -251,7 +251,7 @@ func fieldsByTraversalBase(v reflect.Value, traversals [][]int, values []interfa
|
|||||||
|
|
||||||
for i, traversal := range traversals {
|
for i, traversal := range traversals {
|
||||||
if len(traversal) == 0 {
|
if len(traversal) == 0 {
|
||||||
values[i] = new(interface{})
|
values[i] = new(any)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
f := reflectx.FieldByIndexes(v, traversal)
|
f := reflectx.FieldByIndexes(v, traversal)
|
||||||
|
|||||||
+5
-6
@@ -3,9 +3,8 @@ package sq
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"github.com/jmoiron/sqlx"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"github.com/jmoiron/sqlx"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ func (tx *transaction) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Re
|
|||||||
|
|
||||||
preMeta := PreExecMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext}
|
preMeta := PreExecMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext}
|
||||||
for _, v := range tx.db.lstr {
|
for _, v := range tx.db.lstr {
|
||||||
err := v.PreExec(ctx, langext.Ptr(tx.id), &sqlstr, &prep, preMeta)
|
err := v.PreExec(ctx, new(tx.id), &sqlstr, &prep, preMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, exerr.Wrap(err, "failed to call SQL pre-exec listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
return nil, exerr.Wrap(err, "failed to call SQL pre-exec listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||||
}
|
}
|
||||||
@@ -128,7 +127,7 @@ func (tx *transaction) Exec(ctx context.Context, sqlstr string, prep PP) (sql.Re
|
|||||||
|
|
||||||
postMeta := PostExecMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext, Init: t0, Start: t1, End: time.Now()}
|
postMeta := PostExecMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext, Init: t0, Start: t1, End: time.Now()}
|
||||||
for _, v := range tx.db.lstr {
|
for _, v := range tx.db.lstr {
|
||||||
v.PostExec(langext.Ptr(tx.id), origsql, sqlstr, prep, err, postMeta)
|
v.PostExec(new(tx.id), origsql, sqlstr, prep, err, postMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -144,7 +143,7 @@ func (tx *transaction) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx
|
|||||||
|
|
||||||
preMeta := PreQueryMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext}
|
preMeta := PreQueryMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext}
|
||||||
for _, v := range tx.db.lstr {
|
for _, v := range tx.db.lstr {
|
||||||
err := v.PreQuery(ctx, langext.Ptr(tx.id), &sqlstr, &prep, preMeta)
|
err := v.PreQuery(ctx, new(tx.id), &sqlstr, &prep, preMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, exerr.Wrap(err, "failed to call SQL pre-query listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
return nil, exerr.Wrap(err, "failed to call SQL pre-query listener").Int("tx.id", int(tx.id)).Str("original_sql", origsql).Str("sql", sqlstr).Any("sql_params", prep).Build()
|
||||||
}
|
}
|
||||||
@@ -161,7 +160,7 @@ func (tx *transaction) Query(ctx context.Context, sqlstr string, prep PP) (*sqlx
|
|||||||
|
|
||||||
postMeta := PostQueryMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext, Init: t0, Start: t1, End: time.Now()}
|
postMeta := PostQueryMeta{Context: ctx, TransactionConstructorContext: tx.constructorContext, Init: t0, Start: t1, End: time.Now()}
|
||||||
for _, v := range tx.db.lstr {
|
for _, v := range tx.db.lstr {
|
||||||
v.PostQuery(langext.Ptr(tx.id), origsql, sqlstr, prep, err, postMeta)
|
v.PostQuery(new(tx.id), origsql, sqlstr, prep, err, postMeta)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
+3
-2
@@ -1,7 +1,8 @@
|
|||||||
package syncext
|
package syncext
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"golang.org/x/net/context"
|
context0 "context"
|
||||||
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ func WriteChannelWithTimeout[T any](c chan T, msg T, timeout time.Duration) bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WriteChannelWithContext[T any](ctx context.Context, c chan T, msg T) error {
|
func WriteChannelWithContext[T any](ctx context0.Context, c chan T, msg T) error {
|
||||||
select {
|
select {
|
||||||
case c <- msg:
|
case c <- msg:
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+5
-5
@@ -44,15 +44,15 @@ func NewOpenTimeRange(from *time.Time, to *time.Time) *OpenTimeRange {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r OpenTimeRange) ToMongoPipeline(key string) []interface{} {
|
func (r OpenTimeRange) ToMongoPipeline(key string) []any {
|
||||||
type bsonM map[string]interface{}
|
type bsonM map[string]any
|
||||||
type bsonE struct {
|
type bsonE struct {
|
||||||
Key string
|
Key string
|
||||||
Value interface{}
|
Value any
|
||||||
}
|
}
|
||||||
type bsonD []bsonE
|
type bsonD []bsonE
|
||||||
|
|
||||||
pipeline := make([]interface{}, 0)
|
pipeline := make([]any, 0)
|
||||||
|
|
||||||
if r.From != nil {
|
if r.From != nil {
|
||||||
pipeline = append(pipeline, bsonD{{Key: "$match", Value: bsonM{key: bsonM{"$ne": nil, "$gt": r.From}}}})
|
pipeline = append(pipeline, bsonD{{Key: "$match", Value: bsonM{key: bsonM{"$ne": nil, "$gt": r.From}}}})
|
||||||
@@ -64,7 +64,7 @@ func (r OpenTimeRange) ToMongoPipeline(key string) []interface{} {
|
|||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *OpenTimeRange) AppendToMongoPipeline(pipeline []interface{}, key string) []interface{} {
|
func (r *OpenTimeRange) AppendToMongoPipeline(pipeline []any, key string) []any {
|
||||||
if r == nil {
|
if r == nil {
|
||||||
return pipeline
|
return pipeline
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,10 +51,7 @@ func GetIsoWeekCount(year int) int {
|
|||||||
w2 -= 1
|
w2 -= 1
|
||||||
w3 -= 1
|
w3 -= 1
|
||||||
|
|
||||||
w := w1
|
w := max(w2, w1)
|
||||||
if w2 > w {
|
|
||||||
w = w2
|
|
||||||
}
|
|
||||||
if w3 > w {
|
if w3 > w {
|
||||||
w = w3
|
w = w3
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ func AssertArrayEqual[T comparable](t *testing.T, actual []T, expected []T) {
|
|||||||
t.Errorf("values differ: Actual: '%v', Expected: '%v' (len %d <> %d)", actual, expected, len(actual), len(expected))
|
t.Errorf("values differ: Actual: '%v', Expected: '%v' (len %d <> %d)", actual, expected, len(actual), len(expected))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for i := 0; i < len(actual); i++ {
|
for i := range actual {
|
||||||
if actual[i] != expected[i] {
|
if actual[i] != expected[i] {
|
||||||
t.Errorf("values differ: Actual: '%v', Expected: '%v' (at index %d)", actual, expected, i)
|
t.Errorf("values differ: Actual: '%v', Expected: '%v' (at index %d)", actual, expected, i)
|
||||||
return
|
return
|
||||||
|
|||||||
+3
-3
@@ -2,11 +2,11 @@ package wmo
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"go.mongodb.org/mongo-driver/bson/bsontype"
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
|
||||||
ct "git.blackforestbytes.com/BlackForestBytes/goext/cursortoken"
|
ct "git.blackforestbytes.com/BlackForestBytes/goext/cursortoken"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/bsontype"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ func (c *Coll[TData]) WithDecodeFunc(cdf func(ctx context.Context, dec Decodable
|
|||||||
|
|
||||||
c.EnsureInitializedReflection(example)
|
c.EnsureInitializedReflection(example)
|
||||||
|
|
||||||
c.customDecoder = langext.Ptr(cdf)
|
c.customDecoder = new(cdf)
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -2,10 +2,10 @@ package wmo
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Coll[TData]) InsertOne(ctx context.Context, valueIn TData) (TData, error) {
|
func (c *Coll[TData]) InsertOne(ctx context.Context, valueIn TData) (TData, error) {
|
||||||
@@ -41,7 +41,7 @@ func (c *Coll[TData]) InsertOneUnchecked(ctx context.Context, valueIn any) (TDat
|
|||||||
|
|
||||||
func (c *Coll[TData]) InsertMany(ctx context.Context, valueIn []TData) (*mongo.InsertManyResult, error) {
|
func (c *Coll[TData]) InsertMany(ctx context.Context, valueIn []TData) (*mongo.InsertManyResult, error) {
|
||||||
for _, hook := range c.marshalHooks {
|
for _, hook := range c.marshalHooks {
|
||||||
for i := 0; i < len(valueIn); i++ {
|
for i := range valueIn {
|
||||||
valueIn[i] = hook(valueIn[i])
|
valueIn[i] = hook(valueIn[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ func (c *Coll[TData]) init() {
|
|||||||
|
|
||||||
example := *new(TData)
|
example := *new(TData)
|
||||||
|
|
||||||
datatype := reflect.TypeOf(&example).Elem()
|
datatype := reflect.TypeFor[TData]()
|
||||||
|
|
||||||
if datatype.Kind() == reflect.Interface {
|
if datatype.Kind() == reflect.Interface {
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
|
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/rfctime"
|
"git.blackforestbytes.com/BlackForestBytes/goext/rfctime"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
|
"git.blackforestbytes.com/BlackForestBytes/goext/timeext"
|
||||||
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
|
||||||
@@ -54,7 +53,7 @@ func TestReflectionGetFieldType(t *testing.T) {
|
|||||||
A: "4",
|
A: "4",
|
||||||
},
|
},
|
||||||
Str: "3",
|
Str: "3",
|
||||||
Ptr: langext.Ptr(4),
|
Ptr: new(4),
|
||||||
MDate: t1,
|
MDate: t1,
|
||||||
ODate: nil,
|
ODate: nil,
|
||||||
}
|
}
|
||||||
@@ -208,7 +207,7 @@ func TestReflectionGetFieldValueAsTokenString(t *testing.T) {
|
|||||||
A: "2",
|
A: "2",
|
||||||
},
|
},
|
||||||
Str: "3",
|
Str: "3",
|
||||||
Ptr: langext.Ptr(4),
|
Ptr: new(4),
|
||||||
Num: 22,
|
Num: 22,
|
||||||
FFF: 22.5,
|
FFF: 22.5,
|
||||||
Ptr2: nil,
|
Ptr2: nil,
|
||||||
@@ -239,8 +238,7 @@ func TestReflectionWithInterface(t *testing.T) {
|
|||||||
CDate time.Time `bson:"cdate"`
|
CDate time.Time `bson:"cdate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TestInterface interface {
|
type TestInterface any
|
||||||
}
|
|
||||||
|
|
||||||
coll1 := W[TestInterface](&mongo.Collection{})
|
coll1 := W[TestInterface](&mongo.Collection{})
|
||||||
|
|
||||||
@@ -256,6 +254,6 @@ func TestReflectionWithInterface(t *testing.T) {
|
|||||||
tst.AssertTrue(t, coll2.coll != nil)
|
tst.AssertTrue(t, coll2.coll != nil)
|
||||||
tst.AssertEqual(t, 1, len(coll2.implDataTypeMap))
|
tst.AssertEqual(t, 1, len(coll2.implDataTypeMap))
|
||||||
|
|
||||||
tst.AssertEqual(t, "ID", coll2.implDataTypeMap[reflect.TypeOf(TestData{})]["_id"].Name)
|
tst.AssertEqual(t, "ID", coll2.implDataTypeMap[reflect.TypeFor[TestData]()]["_id"].Name)
|
||||||
tst.AssertEqual(t, "CDate", coll2.implDataTypeMap[reflect.TypeOf(TestData{})]["cdate"].Name)
|
tst.AssertEqual(t, "CDate", coll2.implDataTypeMap[reflect.TypeFor[TestData]()]["cdate"].Name)
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -95,12 +95,12 @@ func (opt *PDFCellOpt) FontSize(v float64) *PDFCellOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) Bold() *PDFCellOpt {
|
func (opt *PDFCellOpt) Bold() *PDFCellOpt {
|
||||||
opt.fontStyleOverride = langext.Ptr(Bold)
|
opt.fontStyleOverride = new(Bold)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) Italic() *PDFCellOpt {
|
func (opt *PDFCellOpt) Italic() *PDFCellOpt {
|
||||||
opt.fontStyleOverride = langext.Ptr(Italic)
|
opt.fontStyleOverride = new(Italic)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,32 +125,32 @@ func (opt *PDFCellOpt) AutoWidthPaddingX(v float64) *PDFCellOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) TextColor(cr, cg, cb int) *PDFCellOpt {
|
func (opt *PDFCellOpt) TextColor(cr, cg, cb int) *PDFCellOpt {
|
||||||
opt.textColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.textColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) TextColorHex(c uint32) *PDFCellOpt {
|
func (opt *PDFCellOpt) TextColorHex(c uint32) *PDFCellOpt {
|
||||||
opt.textColor = langext.Ptr(hexToColor(c))
|
opt.textColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) BorderColor(cr, cg, cb int) *PDFCellOpt {
|
func (opt *PDFCellOpt) BorderColor(cr, cg, cb int) *PDFCellOpt {
|
||||||
opt.borderColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.borderColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) BorderColorHex(c uint32) *PDFCellOpt {
|
func (opt *PDFCellOpt) BorderColorHex(c uint32) *PDFCellOpt {
|
||||||
opt.borderColor = langext.Ptr(hexToColor(c))
|
opt.borderColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) FillColor(cr, cg, cb int) *PDFCellOpt {
|
func (opt *PDFCellOpt) FillColor(cr, cg, cb int) *PDFCellOpt {
|
||||||
opt.fillColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.fillColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFCellOpt) FillColorHex(c uint32) *PDFCellOpt {
|
func (opt *PDFCellOpt) FillColorHex(c uint32) *PDFCellOpt {
|
||||||
opt.fillColor = langext.Ptr(hexToColor(c))
|
opt.fillColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ func (b *WPDFBuilder) Cell(txt string, opts ...*PDFCellOpt) {
|
|||||||
|
|
||||||
if height == nil {
|
if height == nil {
|
||||||
// (do after SetFont, so that b.cellHeight is correctly set to fontOverride)
|
// (do after SetFont, so that b.cellHeight is correctly set to fontOverride)
|
||||||
height = langext.Ptr(b.cellHeight + b.cellSpacing)
|
height = new(b.cellHeight + b.cellSpacing)
|
||||||
}
|
}
|
||||||
|
|
||||||
if textColor != nil {
|
if textColor != nil {
|
||||||
|
|||||||
+5
-5
@@ -23,12 +23,12 @@ func (opt *PDFLineOpt) LineWidth(v float64) *PDFLineOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFLineOpt) DrawColor(cr, cg, cb int) *PDFLineOpt {
|
func (opt *PDFLineOpt) DrawColor(cr, cg, cb int) *PDFLineOpt {
|
||||||
opt.drawColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.drawColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFLineOpt) DrawColorHex(c uint32) *PDFLineOpt {
|
func (opt *PDFLineOpt) DrawColorHex(c uint32) *PDFLineOpt {
|
||||||
opt.drawColor = langext.Ptr(hexToColor(c))
|
opt.drawColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,17 +38,17 @@ func (opt *PDFLineOpt) Alpha(alpha float64, blendMode PDFBlendMode) *PDFLineOpt
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFLineOpt) CapButt() *PDFLineOpt {
|
func (opt *PDFLineOpt) CapButt() *PDFLineOpt {
|
||||||
opt.capStyle = langext.Ptr(CapButt)
|
opt.capStyle = new(CapButt)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFLineOpt) CapSquare() *PDFLineOpt {
|
func (opt *PDFLineOpt) CapSquare() *PDFLineOpt {
|
||||||
opt.capStyle = langext.Ptr(CapSquare)
|
opt.capStyle = new(CapSquare)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFLineOpt) CapRound() *PDFLineOpt {
|
func (opt *PDFLineOpt) CapRound() *PDFLineOpt {
|
||||||
opt.capStyle = langext.Ptr(CapRound)
|
opt.capStyle = new(CapRound)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ func (opt *PDFMultiCellOpt) FontSize(v float64) *PDFMultiCellOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) Bold() *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) Bold() *PDFMultiCellOpt {
|
||||||
opt.fontStyleOverride = langext.Ptr(Bold)
|
opt.fontStyleOverride = new(Bold)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) Italic() *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) Italic() *PDFMultiCellOpt {
|
||||||
opt.fontStyleOverride = langext.Ptr(Italic)
|
opt.fontStyleOverride = new(Italic)
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,32 +95,32 @@ func (opt *PDFMultiCellOpt) X(v float64) *PDFMultiCellOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) TextColor(cr, cg, cb int) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) TextColor(cr, cg, cb int) *PDFMultiCellOpt {
|
||||||
opt.textColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.textColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) TextColorHex(c uint32) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) TextColorHex(c uint32) *PDFMultiCellOpt {
|
||||||
opt.textColor = langext.Ptr(hexToColor(c))
|
opt.textColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) BorderColor(cr, cg, cb int) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) BorderColor(cr, cg, cb int) *PDFMultiCellOpt {
|
||||||
opt.borderColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.borderColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) BorderColorHex(c uint32) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) BorderColorHex(c uint32) *PDFMultiCellOpt {
|
||||||
opt.borderColor = langext.Ptr(hexToColor(c))
|
opt.borderColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) FillColor(cr, cg, cb int) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) FillColor(cr, cg, cb int) *PDFMultiCellOpt {
|
||||||
opt.fillColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.fillColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFMultiCellOpt) FillColorHex(c uint32) *PDFMultiCellOpt {
|
func (opt *PDFMultiCellOpt) FillColorHex(c uint32) *PDFMultiCellOpt {
|
||||||
opt.fillColor = langext.Ptr(hexToColor(c))
|
opt.fillColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -39,22 +39,22 @@ func (opt *PDFRectOpt) LineWidth(v float64) *PDFRectOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFRectOpt) DrawColor(cr, cg, cb int) *PDFRectOpt {
|
func (opt *PDFRectOpt) DrawColor(cr, cg, cb int) *PDFRectOpt {
|
||||||
opt.drawColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.drawColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFRectOpt) DrawColorHex(c uint32) *PDFRectOpt {
|
func (opt *PDFRectOpt) DrawColorHex(c uint32) *PDFRectOpt {
|
||||||
opt.drawColor = langext.Ptr(hexToColor(c))
|
opt.drawColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFRectOpt) FillColor(cr, cg, cb int) *PDFRectOpt {
|
func (opt *PDFRectOpt) FillColor(cr, cg, cb int) *PDFRectOpt {
|
||||||
opt.fillColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
opt.fillColor = new(rgbToColor(cr, cg, cb))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
func (opt *PDFRectOpt) FillColorHex(c uint32) *PDFRectOpt {
|
func (opt *PDFRectOpt) FillColorHex(c uint32) *PDFRectOpt {
|
||||||
opt.fillColor = langext.Ptr(hexToColor(c))
|
opt.fillColor = new(hexToColor(c))
|
||||||
return opt
|
return opt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -339,7 +339,7 @@ func defaultTableStyle() *TableCellStyleOpt {
|
|||||||
FillColorHex(uint32(0xF0F0F0)).
|
FillColorHex(uint32(0xF0F0F0)).
|
||||||
TextColorHex(uint32(0x000000)).
|
TextColorHex(uint32(0x000000)).
|
||||||
FillBackground(true),
|
FillBackground(true),
|
||||||
minWidth: langext.Ptr(float64(5)),
|
minWidth: new(float64(5)),
|
||||||
ellipsize: langext.PTrue,
|
ellipsize: langext.PTrue,
|
||||||
multiCell: langext.PFalse,
|
multiCell: langext.PFalse,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,12 +117,12 @@ func (o *TableCellStyleOpt) FontSize(v float64) *TableCellStyleOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) Bold() *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) Bold() *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.fontStyleOverride = langext.Ptr(Bold)
|
o.PDFCellOpt.fontStyleOverride = new(Bold)
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) Italic() *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) Italic() *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.fontStyleOverride = langext.Ptr(Italic)
|
o.PDFCellOpt.fontStyleOverride = new(Italic)
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,32 +147,32 @@ func (o *TableCellStyleOpt) AutoWidthPaddingX(v float64) *TableCellStyleOpt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) TextColor(cr, cg, cb int) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) TextColor(cr, cg, cb int) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.textColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
o.PDFCellOpt.textColor = new(rgbToColor(cr, cg, cb))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) TextColorHex(c uint32) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) TextColorHex(c uint32) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.textColor = langext.Ptr(hexToColor(c))
|
o.PDFCellOpt.textColor = new(hexToColor(c))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) BorderColor(cr, cg, cb int) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) BorderColor(cr, cg, cb int) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.borderColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
o.PDFCellOpt.borderColor = new(rgbToColor(cr, cg, cb))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) BorderColorHex(c uint32) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) BorderColorHex(c uint32) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.borderColor = langext.Ptr(hexToColor(c))
|
o.PDFCellOpt.borderColor = new(hexToColor(c))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) FillColor(cr, cg, cb int) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) FillColor(cr, cg, cb int) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.fillColor = langext.Ptr(rgbToColor(cr, cg, cb))
|
o.PDFCellOpt.fillColor = new(rgbToColor(cr, cg, cb))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *TableCellStyleOpt) FillColorHex(c uint32) *TableCellStyleOpt {
|
func (o *TableCellStyleOpt) FillColorHex(c uint32) *TableCellStyleOpt {
|
||||||
o.PDFCellOpt.fillColor = langext.Ptr(hexToColor(c))
|
o.PDFCellOpt.fillColor = new(hexToColor(c))
|
||||||
return o
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -50,7 +50,7 @@ func TestPDFBuilder(t *testing.T) {
|
|||||||
TextColorHex(uint32(0x000000)).
|
TextColorHex(uint32(0x000000)).
|
||||||
Align(AlignHorzCenter).
|
Align(AlignHorzCenter).
|
||||||
Bold(),
|
Bold(),
|
||||||
minWidth: langext.Ptr(float64(5)),
|
minWidth: new(float64(5)),
|
||||||
ellipsize: langext.PTrue,
|
ellipsize: langext.PTrue,
|
||||||
multiCell: langext.PFalse,
|
multiCell: langext.PFalse,
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ func TestPDFBuilder(t *testing.T) {
|
|||||||
FillColorHex(uint32(0xC060C0)).
|
FillColorHex(uint32(0xC060C0)).
|
||||||
FillBackground(true).
|
FillBackground(true).
|
||||||
TextColorHex(uint32(0x000000)),
|
TextColorHex(uint32(0x000000)),
|
||||||
minWidth: langext.Ptr(float64(5)),
|
minWidth: new(float64(5)),
|
||||||
ellipsize: langext.PFalse,
|
ellipsize: langext.PFalse,
|
||||||
multiCell: langext.PTrue,
|
multiCell: langext.PTrue,
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user