Browse Source

En cours de développement

master
mls-361 9 months ago
parent
commit
b5bd8ae91f
  1. 1
      Taskfile.yml
  2. 1
      go.mod
  3. 2
      go.sum
  4. 6
      internal/cli/requestor.go
  5. 10
      internal/config/data/server.go
  6. 26
      internal/util/util.go

1
Taskfile.yml

@ -23,6 +23,7 @@ tasks:
- go get -u forge.chapril.org/mls-361/errors
- go get -u forge.chapril.org/mls-361/jsonapi
- go get -u forge.chapril.org/mls-361/logger
- go get -u forge.chapril.org/mls-361/util
- go get -u forge.chapril.org/mls-361/uuid
- go mod tidy

1
go.mod

@ -14,6 +14,7 @@ require (
forge.chapril.org/mls-361/errors v0.0.0-20210507222244-6017b9315140
forge.chapril.org/mls-361/jsonapi v0.0.0-20210808150555-87cb5ce9a0f4
forge.chapril.org/mls-361/logger v0.0.0-20210805205904-6c659f2ae253
forge.chapril.org/mls-361/util v0.0.0-20210814211311-c698de227898
forge.chapril.org/mls-361/uuid v0.1.0
github.com/julienschmidt/httprouter v1.3.0
github.com/maragudk/gomponents v0.16.0

2
go.sum

@ -28,6 +28,8 @@ forge.chapril.org/mls-361/kvfmt v0.0.0-20210507213839-4f18d8b29e73 h1:OKwxmpmkdh
forge.chapril.org/mls-361/kvfmt v0.0.0-20210507213839-4f18d8b29e73/go.mod h1:bv44R0CAd8lQV4ub1hjLE3kWYwpfsW4Ro9zRnD4YOMU=
forge.chapril.org/mls-361/logger v0.0.0-20210805205904-6c659f2ae253 h1:kKtJwB/GoikCP/OChU566z8ORkOK9xR4VwW4htbrqSY=
forge.chapril.org/mls-361/logger v0.0.0-20210805205904-6c659f2ae253/go.mod h1:RMaXNoFyzv7q2enufpbRMCs6U6irdSt5S6l0DtaYFPg=
forge.chapril.org/mls-361/util v0.0.0-20210814211311-c698de227898 h1:JS6i7Nuy/pKyliRF3ZM8EH6WaVbQYNcTwMiUX376c8w=
forge.chapril.org/mls-361/util v0.0.0-20210814211311-c698de227898/go.mod h1:g+yFfYF/opBfo9CG7PKSSq1ih+g0ld+KjLUOujlMktI=
forge.chapril.org/mls-361/uuid v0.1.0 h1:qYPucVw9w8CzSD54bcsO7MSgx4NWIh5fT2YccP3mEb0=
forge.chapril.org/mls-361/uuid v0.1.0/go.mod h1:+uu8csAnhTKtJtk8EFgLJVarHTVe71Bj6skaCNLGmSg=
github.com/MarvinJWendt/testza v0.2.0 h1:rieLkU80MjsTHYiGB8o//5sXRnXbaraEaFxe6vfEXMY=

6
internal/cli/requestor.go

@ -45,9 +45,9 @@ func newRequestor(ccs *components.Components) (jw.Model, error) {
Endpoints: []*requestor.Endpoint{endpoint},
}
if cli := cfg.TLS.Cli; cli != nil {
rc.Cert = cli.Cert
rc.Key = cli.Key
if cfg.TLS != nil {
rc.Cert = cfg.TLS.Cert
rc.Key = cfg.TLS.Key
}
return requestor.New(rc)

10
internal/config/data/server.go

@ -8,18 +8,11 @@ package data
import (
"forge.chapril.org/mls-361/errors"
"forge.chapril.org/armen/armen/internal/util"
"forge.chapril.org/mls-361/util"
)
const _defaultServerPort = 65530
// Cli AFAIRE.
type Cli struct {
Cert string
Key string
}
// TLS AFAIRE.
type TLS struct {
Host string
@ -27,7 +20,6 @@ type TLS struct {
Key string
AuthType int
CA string
Cli *Cli
}
// Server AFAIRE.

26
internal/util/util.go

@ -1,26 +0,0 @@
/*
------------------------------------------------------------------------------------------------------------------------
####### util ####### Copyright (c) 2021 mls-361 #################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package util
import "os"
// PathExists AFAIRE.
func PathExists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
/*
######################################################################################################## @(°_°)@ #######
*/
Loading…
Cancel
Save