Rework ioutils/gzipreader/fileprogress

Package ioutils:
- remove file progress from ioutils and rework it to package
  file/progress

Package file/progress:
- simplify call / use of file progress
- optimize code
- use atomic to function progress
- isolation part of code
- make interface more compatible with *os/File / io interface

Package archive/gzipreader
- create package to expose a io.reader interface from a no gzipped io.reader
- add interface GZipReader to expose metrics like rate of compression

Package archive:
- apply following change
- add minor internal change into errors files

Package artifact:
- apply following change
- add minor internal change into errors files

Package aws:
- apply following change
- removing minio server from repo

Package mail:
- apply following change
- add minor internal change into errors files

Package nutsdb:
- apply following change
- add minor internal change into errors files

Package static:
- apply following change

Other:
- bump dependencies
- ci/cd : add a wget command to dl minio server for testing
- add aws/minio to gitignore
This commit is contained in:
nabbar
2023-08-22 18:37:07 +02:00
parent 3a2c52195f
commit c4b5f11efc
54 changed files with 1734 additions and 1136 deletions

View File

@@ -30,10 +30,10 @@ import (
"net/http"
"strings"
"github.com/google/go-github/v33/github"
"github.com/nabbar/golib/artifact"
"github.com/nabbar/golib/artifact/client"
"github.com/nabbar/golib/errors"
github "github.com/google/go-github/v33/github"
libart "github.com/nabbar/golib/artifact"
artcli "github.com/nabbar/golib/artifact/client"
liberr "github.com/nabbar/golib/errors"
)
func getOrgProjectFromRepos(repos string) (owner string, project string) {
@@ -45,11 +45,11 @@ func getOrgProjectFromRepos(repos string) (owner string, project string) {
return lst[0], lst[1]
}
func NewGithub(ctx context.Context, httpcli *http.Client, repos string) (cli artifact.Client, err errors.Error) {
func NewGithub(ctx context.Context, httpcli *http.Client, repos string) (cli libart.Client, err liberr.Error) {
o, p := getOrgProjectFromRepos(repos)
a := &githubModel{
ClientHelper: client.ClientHelper{},
ClientHelper: artcli.ClientHelper{},
c: github.NewClient(httpcli),
x: ctx,
o: o,
@@ -61,11 +61,11 @@ func NewGithub(ctx context.Context, httpcli *http.Client, repos string) (cli art
return a, err
}
func NewGithubWithTokenOAuth(ctx context.Context, repos string, oauth2client *http.Client) (cli artifact.Client, err errors.Error) {
func NewGithubWithTokenOAuth(ctx context.Context, repos string, oauth2client *http.Client) (cli libart.Client, err liberr.Error) {
o, p := getOrgProjectFromRepos(repos)
a := &githubModel{
ClientHelper: client.ClientHelper{},
ClientHelper: artcli.ClientHelper{},
c: github.NewClient(oauth2client),
x: ctx,
o: o,