MM-37186: Update dependencies (#18604)
* MM-37186: Update dependencies The split client libraries were excluded from being upgraded. See: https://github.com/splitio/go-split-commons/issues/56 https://mattermost.atlassian.net/browse/MM-37186 ```release-note NONE ``` * Ignore staticcheck deprecation warnings ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2898f988fc
Коммит
76d492f9ab
12
vendor/code.sajari.com/docconv/README.md
сгенерированный
поставляемый
12
vendor/code.sajari.com/docconv/README.md
сгенерированный
поставляемый
@@ -50,13 +50,15 @@ The `docd` tool runs as either:
|
||||
|
||||
2. a service exposed from within a Docker container
|
||||
|
||||
This also runs as a service, but from within a Docker container. There are three build scripts:
|
||||
This also runs as a service, but from within a Docker container.
|
||||
Official images are published at https://hub.docker.com/r/sajari/docd.
|
||||
|
||||
- [./docd/debian.sh](./docd/debian.sh)
|
||||
- [./docd/alpine.sh](./docd/alpine.sh)
|
||||
- [./docd/appengine.sh](./docd/appengine.sh)
|
||||
Optionally you can build it yourself:
|
||||
|
||||
The `debian` version uses the Debian package repository which can vary with builds. The `alpine` version uses a very cut down Linux distribution to produce a container ~40MB. It also locks the dependency versions for consistency, but may miss out on future updates. The `appengine` version is a flex based custom runtime for Google Cloud.
|
||||
```
|
||||
cd docd
|
||||
docker build -t docd .
|
||||
```
|
||||
|
||||
3. via the command line.
|
||||
|
||||
|
||||
41
vendor/code.sajari.com/docconv/doc.go
сгенерированный
поставляемый
41
vendor/code.sajari.com/docconv/doc.go
сгенерированный
поставляемый
@@ -8,8 +8,10 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/richardlehane/mscfb"
|
||||
"github.com/richardlehane/msoleps"
|
||||
)
|
||||
|
||||
// ConvertDoc converts an MS Word .doc to text.
|
||||
@@ -23,28 +25,43 @@ func ConvertDoc(r io.Reader) (string, map[string]string, error) {
|
||||
// Meta data
|
||||
mc := make(chan map[string]string, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
log.Printf("panic when reading doc format: %v", e)
|
||||
}
|
||||
}()
|
||||
|
||||
meta := make(map[string]string)
|
||||
metaStr, err := exec.Command("wvSummary", f.Name()).Output()
|
||||
|
||||
doc, err := mscfb.New(f)
|
||||
if err != nil {
|
||||
// TODO: Remove this.
|
||||
log.Println("wvSummary:", err)
|
||||
log.Printf("ConvertDoc: could not read doc: %v", err)
|
||||
}
|
||||
|
||||
// Parse meta output
|
||||
for _, line := range strings.Split(string(metaStr), "\n") {
|
||||
if parts := strings.SplitN(line, "=", 2); len(parts) > 1 {
|
||||
meta[strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1])
|
||||
props := msoleps.New()
|
||||
for entry, err := doc.Next(); err == nil; entry, err = doc.Next() {
|
||||
if msoleps.IsMSOLEPS(entry.Initial) {
|
||||
if oerr := props.Reset(doc); oerr != nil {
|
||||
log.Printf("ConvertDoc: could not reset props: %v", oerr)
|
||||
break
|
||||
}
|
||||
|
||||
for _, prop := range props.Property {
|
||||
meta[prop.Name] = prop.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const defaultTimeFormat = "2006-01-02 15:04:05.999999999 -0700 MST"
|
||||
|
||||
// Convert parsed meta
|
||||
if tmp, ok := meta["Last Modified"]; ok {
|
||||
if t, err := time.Parse(time.RFC3339, tmp); err == nil {
|
||||
if tmp, ok := meta["LastSaveTime"]; ok {
|
||||
if t, err := time.Parse(defaultTimeFormat, tmp); err == nil {
|
||||
meta["ModifiedDate"] = fmt.Sprintf("%d", t.Unix())
|
||||
}
|
||||
}
|
||||
if tmp, ok := meta["Created"]; ok {
|
||||
if t, err := time.Parse(time.RFC3339, tmp); err == nil {
|
||||
if tmp, ok := meta["CreateTime"]; ok {
|
||||
if t, err := time.Parse(defaultTimeFormat, tmp); err == nil {
|
||||
meta["CreatedDate"] = fmt.Sprintf("%d", t.Unix())
|
||||
}
|
||||
}
|
||||
|
||||
2
vendor/code.sajari.com/docconv/go.mod
сгенерированный
поставляемый
2
vendor/code.sajari.com/docconv/go.mod
сгенерированный
поставляемый
@@ -17,6 +17,8 @@ require (
|
||||
github.com/olekukonko/tablewriter v0.0.4 // indirect
|
||||
github.com/otiai10/gosseract/v2 v2.2.4
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/richardlehane/mscfb v1.0.3 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.1 // indirect
|
||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
|
||||
golang.org/x/text v0.3.2 // indirect
|
||||
)
|
||||
|
||||
4
vendor/code.sajari.com/docconv/go.sum
сгенерированный
поставляемый
4
vendor/code.sajari.com/docconv/go.sum
сгенерированный
поставляемый
@@ -55,6 +55,10 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/richardlehane/mscfb v1.0.3 h1:rD8TBkYWkObWO0oLDFCbwMeZ4KoalxQy+QgniCj3nKI=
|
||||
github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
|
||||
github.com/richardlehane/msoleps v1.0.1 h1:RfrALnSNXzmXLbGct/P2b4xkFz4e8Gmj/0Vj9M9xC1o=
|
||||
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
|
||||
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo=
|
||||
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM=
|
||||
|
||||
Ссылка в новой задаче
Block a user