rewrite it in rust
This commit is contained in:
parent
c1b1138779
commit
00e3bf6348
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -3,3 +3,7 @@ build
|
|||
result
|
||||
.direnv
|
||||
musicutil_old
|
||||
|
||||
# Added by cargo
|
||||
|
||||
/target
|
||||
|
|
1023
Cargo.lock
generated
Normal file
1023
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
23
Cargo.toml
Normal file
23
Cargo.toml
Normal file
|
@ -0,0 +1,23 @@
|
|||
[package]
|
||||
name = "musicutil"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.143", features = ["derive"] }
|
||||
clap = { version = "3.2.17", features = ["derive"] }
|
||||
serde_yaml = "0.9.9"
|
||||
serde_json = "1.0"
|
||||
directories-next = "2.0.0"
|
||||
log = { version = "0.4.17", features = ["kv_unstable"] }
|
||||
serde_with = "1.3.1"
|
||||
lazy_static = "1.4.0"
|
||||
walkdir = "2.3.2"
|
||||
audiotags = "0.4.1"
|
||||
html-escape = "0.2.11"
|
||||
string-error = "0.1.0"
|
||||
tempfile = "3"
|
||||
notify = "4.0.17"
|
||||
crossbeam = "0.8"
|
|
@ -1,302 +0,0 @@
|
|||
package copy
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils/transcoder"
|
||||
)
|
||||
|
||||
type CopyCommandArgs struct {
|
||||
Source *string
|
||||
Dest *string
|
||||
TranscodePreset *string
|
||||
Threads *int
|
||||
SkipExisting *bool
|
||||
SingleDirectory *bool
|
||||
}
|
||||
|
||||
func dirNotExistValidator(directory string) error {
|
||||
fileInfo, err := os.Stat(directory)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s does not exist", directory)
|
||||
}
|
||||
|
||||
if !fileInfo.IsDir() {
|
||||
return fmt.Errorf("%s is not a directory", directory)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func fileExists(filepath string) bool {
|
||||
if _, err := os.Stat(filepath); err == nil {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func copyFile(src, dest string) error {
|
||||
_, err := os.Stat(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
source, err := os.Open(src)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer source.Close()
|
||||
|
||||
destination, err := os.Create(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer destination.Close()
|
||||
|
||||
_, err = io.Copy(destination, source)
|
||||
return err
|
||||
}
|
||||
|
||||
func RegisterCopyCommand(parser *argparse.Parser) (*argparse.Command, *CopyCommandArgs) {
|
||||
cmd := parser.NewCommand("copy", "copies files with or without transcoding")
|
||||
|
||||
arguments := &CopyCommandArgs{}
|
||||
arguments.Source = cmd.String("s", "src", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
return dirNotExistValidator(args[0])
|
||||
},
|
||||
})
|
||||
|
||||
arguments.Dest = cmd.String("d", "dest", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
return dirNotExistValidator(args[0])
|
||||
},
|
||||
})
|
||||
|
||||
arguments.TranscodePreset = cmd.String("p", "transcode-preset", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
if args[0] == "list" {
|
||||
transcoder.PrintTranscodePresets()
|
||||
os.Exit(0)
|
||||
} else if args[0] == "copy" {
|
||||
return nil
|
||||
}
|
||||
|
||||
if _, err := transcoder.GetPresetByName(args[0]); err != nil {
|
||||
return fmt.Errorf("Preset does not exist")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
arguments.SkipExisting = cmd.Flag("", "skip-existing", &argparse.Options{
|
||||
Default: false,
|
||||
})
|
||||
|
||||
arguments.SingleDirectory = cmd.Flag("", "single-directory", &argparse.Options{
|
||||
Default: false,
|
||||
})
|
||||
|
||||
arguments.Threads = cmd.Int("", "threads", &argparse.Options{
|
||||
Default: 0,
|
||||
})
|
||||
|
||||
return cmd, arguments
|
||||
}
|
||||
|
||||
type CopyCommand struct {
|
||||
Args *CopyCommandArgs
|
||||
Files []*types.File
|
||||
}
|
||||
|
||||
func NewCopyCommand(args *CopyCommandArgs) *CopyCommand {
|
||||
return &CopyCommand{
|
||||
Args: args,
|
||||
Files: make([]*types.File, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) scan_for_music() {
|
||||
log.Info().Msg("Scanning For Music")
|
||||
|
||||
files, err := utils.ScanForMusic(*c.Args.Source)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
c.Files = files
|
||||
}
|
||||
|
||||
func (c *CopyCommand) check_for_duplicates() {
|
||||
log.Info().Msg("Creating For Duplicates")
|
||||
seen := make(map[string]bool)
|
||||
dupes := make([]string, 0)
|
||||
|
||||
for _, file := range c.Files {
|
||||
filename := file.JoinFilename()
|
||||
if _, ok := seen[filename]; ok {
|
||||
dupes = append(dupes, filename)
|
||||
} else {
|
||||
seen[filename] = true
|
||||
}
|
||||
}
|
||||
|
||||
if len(dupes) > 0 {
|
||||
log.Fatal().Strs("dupes", dupes).Msg("Duplicates Found, please rename/remove.")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) create_directories() {
|
||||
log.Info().Msg("Creating Directories")
|
||||
|
||||
directories := make(map[string]bool)
|
||||
for _, file := range c.Files {
|
||||
directories[file.PathFromSource] = true
|
||||
}
|
||||
|
||||
for dir := range directories {
|
||||
if file_info, err := os.Stat(*c.Args.Dest + "/" + dir); err == nil {
|
||||
if file_info.IsDir() {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
log.Info().Str("dir", dir).Msg("Creating Directory")
|
||||
|
||||
err := os.MkdirAll(*c.Args.Dest+"/"+dir, os.ModePerm)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not create directory")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) _transcode_file(file *types.File, trans_config *transcoder.TranscodeConfig, is_threaded bool) {
|
||||
new_filename := file.Filename + "." + trans_config.FileExtension
|
||||
dest_filepath := *c.Args.Dest + "/"
|
||||
|
||||
if *c.Args.SingleDirectory {
|
||||
dest_filepath = dest_filepath + new_filename
|
||||
} else {
|
||||
dest_filepath = dest_filepath + file.PathFromSource + "/" + new_filename
|
||||
}
|
||||
|
||||
if *c.Args.SkipExisting && fileExists(dest_filepath) {
|
||||
log.Info().Str("file", new_filename).
|
||||
Msg("Skipping transcode as file already exists")
|
||||
return
|
||||
} else {
|
||||
log.Info().Str("file", new_filename).Msg("Transcoding")
|
||||
}
|
||||
|
||||
output, err := transcoder.Transcode(file, trans_config, nil, dest_filepath)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Str("output", output).Msg("Transcode Failed")
|
||||
} else if is_threaded {
|
||||
log.Info().Str("file", new_filename).Msg("Finished Transcoding")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) transcode_files() {
|
||||
log.Info().Msg("Transcoding Files")
|
||||
|
||||
// TODO: Implement custom transcode config file
|
||||
trans_preset, err :=
|
||||
transcoder.GetPresetByName(*c.Args.TranscodePreset)
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not get transcode preset")
|
||||
}
|
||||
if *c.Args.Threads == 0 {
|
||||
for _, file := range c.Files {
|
||||
c._transcode_file(file, trans_preset.Config, false)
|
||||
}
|
||||
} else {
|
||||
var wg sync.WaitGroup
|
||||
threads := *c.Args.Threads
|
||||
jobs := make(chan *types.File, threads)
|
||||
|
||||
for i := 1; i <= threads; i++ {
|
||||
go func() {
|
||||
for file := range jobs {
|
||||
defer wg.Done()
|
||||
c._transcode_file(file, trans_preset.Config, true)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
for _, file := range c.Files {
|
||||
wg.Add(1)
|
||||
jobs <- file
|
||||
}
|
||||
|
||||
close(jobs)
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (c *CopyCommand) _copy_file(file *types.File) {
|
||||
src_filepath := file.JoinPathTo()
|
||||
dest_filepath := ""
|
||||
if *c.Args.SingleDirectory {
|
||||
dest_filepath = *c.Args.Dest + "/" + file.JoinFilename()
|
||||
} else {
|
||||
dest_filepath = *c.Args.Dest + "/" + file.JoinPathFromSource()
|
||||
}
|
||||
|
||||
exists := fileExists(dest_filepath)
|
||||
|
||||
if exists {
|
||||
log.Info().Str("file", dest_filepath).
|
||||
Msg("Skipping as already exists in destination")
|
||||
} else {
|
||||
log.Info().
|
||||
Str("file", file.JoinFilename()).
|
||||
Msg("Copying File")
|
||||
err := copyFile(src_filepath, dest_filepath)
|
||||
if err != nil {
|
||||
log.Panic().
|
||||
Err(err).
|
||||
Str("file", file.JoinFilename()).
|
||||
Msg("Error Copying File")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) copy_files() {
|
||||
log.Info().Msg("Copying Files Into Dest")
|
||||
|
||||
for _, file := range c.Files {
|
||||
c._copy_file(file)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CopyCommand) Run() {
|
||||
log.Info().Msg("Copying Files")
|
||||
|
||||
c.scan_for_music()
|
||||
|
||||
if !*c.Args.SingleDirectory {
|
||||
c.create_directories()
|
||||
} else {
|
||||
c.check_for_duplicates()
|
||||
}
|
||||
|
||||
if *c.Args.TranscodePreset == "copy" {
|
||||
c.copy_files()
|
||||
} else {
|
||||
c.transcode_files()
|
||||
}
|
||||
|
||||
}
|
|
@ -1,181 +0,0 @@
|
|||
package genhtml
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html"
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils"
|
||||
)
|
||||
|
||||
type GenHTMLCommandArgs struct {
|
||||
Source *string
|
||||
Dest *string
|
||||
Title *string
|
||||
Description *string
|
||||
}
|
||||
|
||||
func RegisterGenHTMLCommand(parser *argparse.Parser) (*argparse.Command, *GenHTMLCommandArgs) {
|
||||
cmd := parser.NewCommand("genhtml", "generates a html file or multiple html files for showing music library")
|
||||
|
||||
arguments := &GenHTMLCommandArgs{}
|
||||
arguments.Source = cmd.String("s", "src", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
fileInfo, err := os.Stat(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("Source does not exist")
|
||||
}
|
||||
|
||||
if !fileInfo.IsDir() {
|
||||
return fmt.Errorf("Source is not a directory")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
arguments.Dest = cmd.String("d", "dest", &argparse.Options{Required: true})
|
||||
|
||||
arguments.Title = cmd.String("", "title", &argparse.Options{Default: ""})
|
||||
arguments.Description = cmd.String("", "description", &argparse.Options{Default: ""})
|
||||
|
||||
return cmd, arguments
|
||||
}
|
||||
|
||||
type GenHTMLCommand struct {
|
||||
Args *GenHTMLCommandArgs
|
||||
Files []*types.File
|
||||
}
|
||||
|
||||
func NewGenHTMLCommand(args *GenHTMLCommandArgs) *GenHTMLCommand {
|
||||
return &GenHTMLCommand{
|
||||
Args: args,
|
||||
Files: make([]*types.File, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *GenHTMLCommand) scan_for_music() {
|
||||
log.Info().Msg("Scanning For Music")
|
||||
|
||||
files, err := utils.ScanForMusic(*c.Args.Source)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
c.Files = files
|
||||
}
|
||||
|
||||
func (c *GenHTMLCommand) load_tag_information() {
|
||||
log.Info().Msg("Loading Tag Information")
|
||||
|
||||
for _, file := range c.Files {
|
||||
log.Info().Str("file", file.JoinFilename()).Msg("Loading Tags")
|
||||
tags, err := utils.ExtractTags(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
file.Tags = tags
|
||||
}
|
||||
}
|
||||
|
||||
func (c *GenHTMLCommand) Run() {
|
||||
log.Info().Msg("Generating HTML")
|
||||
|
||||
c.scan_for_music()
|
||||
c.load_tag_information()
|
||||
|
||||
sort.Slice(c.Files, func(i, j int) bool {
|
||||
if c.Files[i].PathFromSource != c.Files[j].PathFromSource {
|
||||
return c.Files[i].PathFromSource < c.Files[j].PathFromSource
|
||||
}
|
||||
if c.Files[i].Tags.Title != c.Files[j].Tags.Title {
|
||||
return c.Files[i].Tags.Title < c.Files[j].Tags.Title
|
||||
}
|
||||
|
||||
return c.Files[i].Tags.Artist < c.Files[j].Tags.Artist
|
||||
})
|
||||
|
||||
html_content := ""
|
||||
html_content = html_content + fmt.Sprintf(`
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.6/build/pure-min.css">
|
||||
<title>%s</title>
|
||||
<meta property="og:title" content="%s" />
|
||||
<meta property="og:description" content="%s" />
|
||||
</head>
|
||||
<body>
|
||||
`, *c.Args.Title, *c.Args.Title, *c.Args.Description)
|
||||
|
||||
html_content = html_content + tableForFiles(c.Files, true)
|
||||
|
||||
html_content = html_content + "</body></html>"
|
||||
|
||||
html_file, err := os.Create(*c.Args.Dest + "/index.html")
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Could not write HTML file")
|
||||
}
|
||||
defer html_file.Close()
|
||||
html_file.Write([]byte(html_content))
|
||||
}
|
||||
|
||||
func tableForFiles(files []*types.File, includesPath bool) string {
|
||||
html_content := ""
|
||||
path_head := ""
|
||||
if includesPath {
|
||||
path_head = "<th>Path</th>"
|
||||
}
|
||||
|
||||
html_content += fmt.Sprintf(`
|
||||
<table class="pure-table pure-table-horizontal">
|
||||
<thead>
|
||||
<tr>
|
||||
%s
|
||||
<th>Title</th>
|
||||
<th>Artist</th>
|
||||
<th>Format</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`, path_head)
|
||||
|
||||
isOdd := true
|
||||
for _, file := range files {
|
||||
tdClass := "pure-table-even"
|
||||
if isOdd {
|
||||
tdClass = "pure-table-odd"
|
||||
}
|
||||
|
||||
data_title := html.EscapeString(file.Tags.Title)
|
||||
data_artist := html.EscapeString(file.Tags.Artist)
|
||||
data_extension := html.EscapeString(file.Extension)
|
||||
|
||||
path_data := ""
|
||||
if includesPath {
|
||||
data_path := html.EscapeString(file.PathFromSource)
|
||||
path_data = fmt.Sprintf("<td>%s</td>", data_path)
|
||||
}
|
||||
|
||||
html_content = html_content + fmt.Sprintf(`
|
||||
<tr class="%s">
|
||||
%s
|
||||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
<td>%s</td>
|
||||
</tr>
|
||||
`, tdClass, path_data, data_title, data_artist, data_extension)
|
||||
isOdd = !isOdd
|
||||
}
|
||||
html_content = html_content + `
|
||||
</tbody>
|
||||
</table>
|
||||
`
|
||||
return html_content
|
||||
}
|
|
@ -1,165 +0,0 @@
|
|||
package process
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils/ascii_reduce"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils/tag_cache"
|
||||
)
|
||||
|
||||
type ProcessCommandArgs struct {
|
||||
Source *string
|
||||
DryRun *bool
|
||||
}
|
||||
|
||||
func RegisterProcessCommand(parser *argparse.Parser) (*argparse.Command, *ProcessCommandArgs) {
|
||||
cmd := parser.NewCommand("process", "")
|
||||
|
||||
arguments := &ProcessCommandArgs{}
|
||||
arguments.Source = cmd.String("s", "src", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
fileInfo, err := os.Stat(args[0])
|
||||
if err != nil {
|
||||
return fmt.Errorf("Source does not exist")
|
||||
}
|
||||
|
||||
if !fileInfo.IsDir() {
|
||||
return fmt.Errorf("Source is not a directory")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
arguments.DryRun = cmd.Flag("", "dry-run", &argparse.Options{})
|
||||
|
||||
return cmd, arguments
|
||||
}
|
||||
|
||||
type ProcessCommand struct {
|
||||
Args *ProcessCommandArgs
|
||||
Files []*types.File
|
||||
TagCache *tag_cache.TagCache
|
||||
}
|
||||
|
||||
func NewProcessCommand(args *ProcessCommandArgs) *ProcessCommand {
|
||||
return &ProcessCommand{
|
||||
Args: args,
|
||||
Files: make([]*types.File, 0),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ProcessCommand) Run() {
|
||||
log.Info().Str("dir", *c.Args.Source).Msg("Processing")
|
||||
|
||||
c.TagCache = tag_cache.NewTagCache(*c.Args.Source)
|
||||
defer c.TagCache.Close()
|
||||
c.scan_for_music()
|
||||
c.load_tag_information()
|
||||
c.rename_files()
|
||||
}
|
||||
|
||||
func (c *ProcessCommand) scan_for_music() {
|
||||
log.Info().Msg("Scanning For Music")
|
||||
files, err := utils.ScanForMusic(*c.Args.Source)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
c.Files = files
|
||||
}
|
||||
|
||||
func (c *ProcessCommand) load_tag_information() {
|
||||
log.Info().Msg("Load Tag Information")
|
||||
|
||||
for _, file := range c.Files {
|
||||
if cached_tags, ok := c.TagCache.IsCached(file); !ok {
|
||||
log.Info().Str("file", file.JoinFilename()).Msg("Loading Tags")
|
||||
|
||||
tags, err := utils.ExtractTags(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
file.Tags = tags
|
||||
c.TagCache.AddToCache(file, tags)
|
||||
} else {
|
||||
log.Info().Str("file", file.JoinFilename()).Msg("Loading Tags From Cache")
|
||||
file.Tags = cached_tags
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// returns the new file so if renamed,
|
||||
// any step after it is ran can operate on file
|
||||
// if dry run then returns orig file without changed filename
|
||||
func (c *ProcessCommand) rename_file(file *types.File) *types.File {
|
||||
title := file.Tags.Title
|
||||
artist := file.Tags.Artist
|
||||
|
||||
replace_char := "_"
|
||||
|
||||
// Step 1: Remove Newlines
|
||||
title = strings.ReplaceAll(title, "\n", "")
|
||||
artist = strings.ReplaceAll(artist, "\n", "")
|
||||
|
||||
// Step 2: Strip ASCII
|
||||
title = ascii_reduce.Reduce(title, replace_char)
|
||||
artist = ascii_reduce.Reduce(artist, replace_char)
|
||||
|
||||
// Step 3: Remove File Seperators
|
||||
title = strings.ReplaceAll(title, "\\", replace_char)
|
||||
title = strings.ReplaceAll(title, "/", replace_char)
|
||||
artist = strings.ReplaceAll(artist, "\\", replace_char)
|
||||
artist = strings.ReplaceAll(artist, "/", replace_char)
|
||||
|
||||
// Step 4: Join Filename
|
||||
filename := fmt.Sprintf("%s - %s", artist, title)
|
||||
|
||||
if filename == file.Filename {
|
||||
return file
|
||||
}
|
||||
|
||||
// Step 5: Make new File with filename set
|
||||
new_file := file.DeepCopy()
|
||||
if !*c.Args.DryRun {
|
||||
new_file.Filename = filename
|
||||
}
|
||||
|
||||
// Step 6: Rename File
|
||||
log.Info().
|
||||
Str("old", file.Filename).
|
||||
Str("new", filename).
|
||||
Msg("Renaming File")
|
||||
|
||||
if !*c.Args.DryRun {
|
||||
if _, err := os.Stat(new_file.JoinPathTo()); err == nil {
|
||||
log.Fatal().
|
||||
Str("old", file.JoinFilename()).
|
||||
Str("new", new_file.JoinFilename()).
|
||||
Msg("Refusing to rename files, please retag to be distinct")
|
||||
}
|
||||
|
||||
err := os.Rename(file.JoinPathTo(), new_file.JoinPathTo())
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Failed to rename file")
|
||||
}
|
||||
}
|
||||
|
||||
return new_file
|
||||
}
|
||||
|
||||
func (c *ProcessCommand) rename_files() {
|
||||
log.Info().Msg("Renaming Files")
|
||||
|
||||
for _, file := range c.Files {
|
||||
c.rename_file(file)
|
||||
}
|
||||
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package transcode
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils/transcoder"
|
||||
)
|
||||
|
||||
type TranscodeCommandArgs struct {
|
||||
Source *string
|
||||
Dest *string
|
||||
TranscodePreset *string
|
||||
IgnoreExtension *bool
|
||||
}
|
||||
|
||||
func RegisterTranscodeCommand(parser *argparse.Parser) (*argparse.Command, *TranscodeCommandArgs) {
|
||||
cmd := parser.NewCommand("transcode", "Transcode a audio file from one format to another")
|
||||
|
||||
arguments := &TranscodeCommandArgs{}
|
||||
arguments.Source = cmd.String("s", "src", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
if _, err := os.Stat(args[0]); err != nil {
|
||||
return fmt.Errorf("Source file does not exist")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
arguments.Dest = cmd.String("d", "dest", &argparse.Options{})
|
||||
|
||||
arguments.TranscodePreset = cmd.String("p", "transcode-preset", &argparse.Options{
|
||||
Required: true,
|
||||
Validate: func(args []string) error {
|
||||
if args[0] == "list" {
|
||||
transcoder.PrintTranscodePresets()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
if _, err := transcoder.GetPresetByName(args[0]); err != nil {
|
||||
return fmt.Errorf("Preset does not exist")
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
arguments.IgnoreExtension = cmd.Flag("", "ignore-extension", &argparse.Options{})
|
||||
|
||||
return cmd, arguments
|
||||
}
|
||||
|
||||
type TranscodeCommand struct {
|
||||
Args *TranscodeCommandArgs
|
||||
}
|
||||
|
||||
func NewTranscodeCommand(args *TranscodeCommandArgs) *TranscodeCommand {
|
||||
return &TranscodeCommand{
|
||||
Args: args,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *TranscodeCommand) Run() {
|
||||
log.Info().
|
||||
Str("src", *c.Args.Source).
|
||||
Str("dest", *c.Args.Dest).
|
||||
Msg("Transcoding")
|
||||
|
||||
var transcode_config *transcoder.TranscodeConfig
|
||||
|
||||
// TODO: Reimplement custom transcode config file loading
|
||||
if len(*c.Args.TranscodePreset) != 0 {
|
||||
preset, err := transcoder.GetPresetByName(*c.Args.TranscodePreset)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
transcode_config = preset.Config
|
||||
}
|
||||
}
|
||||
|
||||
input_file := types.FileFromPath("", *c.Args.Source)
|
||||
output_file := types.FileFromPath("", *c.Args.Dest)
|
||||
|
||||
if !*c.Args.IgnoreExtension && transcode_config.FileExtension != output_file.Extension {
|
||||
log.Error().Msgf(
|
||||
"%s is not the recommended "+
|
||||
"extension for specified transcode config "+
|
||||
"please change it to %s "+
|
||||
"or run with --ignore-extension",
|
||||
output_file.Extension, transcode_config.FileExtension)
|
||||
}
|
||||
|
||||
progress_chan := make(chan string)
|
||||
go func() {
|
||||
for {
|
||||
progress, isnt_closed := <-progress_chan
|
||||
if isnt_closed {
|
||||
log.Info().
|
||||
Str("src", *c.Args.Source).
|
||||
Str("progress", progress).
|
||||
Msg("Transcoding")
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
output, err := transcoder.Transcode(input_file, transcode_config, progress_chan, output_file.JoinPathTo())
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Str("output", output).Msg("Transcode Failed")
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func init() {
|
||||
viper.SetConfigName("musicutil")
|
||||
viper.SetConfigType("yaml")
|
||||
viper.AddConfigPath("$HOME/.config")
|
||||
viper.AddConfigPath("$XDG_CONFIG_HOME")
|
||||
|
||||
viper.SetDefault("log_level", "info")
|
||||
viper.SetDefault("cache", false)
|
||||
viper.SetDefault("cache_dir", "source_dir")
|
||||
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, isNotFound := err.(viper.ConfigFileNotFoundError); !isNotFound {
|
||||
panic(fmt.Errorf("Fatal error config file: %w \n", err))
|
||||
}
|
||||
}
|
||||
}
|
16
flake.nix
16
flake.nix
|
@ -17,21 +17,20 @@
|
|||
overlay = final: prev:
|
||||
let system = final.system;
|
||||
in {
|
||||
musicutil = final.buildGoModule rec {
|
||||
musicutil = final.rustPlatform.buildRustPackage rec {
|
||||
pname = "musicutil";
|
||||
version = "latest";
|
||||
|
||||
src = ./.;
|
||||
cargoLock = { lockFile = ./Cargo.lock; };
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace meta/meta.go --replace 'var ffmpeg_path = "ffmpeg"' 'var ffmpeg_path = "${final.ffmpeg}/bin/ffmpeg"'
|
||||
substituteInPlace meta/meta.go --replace 'var ffprobe_path = "ffprobe"' 'var ffprobe_path = "${final.ffmpeg}/bin/ffprobe"'
|
||||
substituteInPlace src/meta/mod.rs --replace 'ffmpeg' '${final.ffmpeg}/bin/ffmpeg'
|
||||
substituteInPlace src/meta/mod.rs --replace 'ffprobe' '${final.ffmpeg}/bin/ffprobe'
|
||||
'';
|
||||
|
||||
vendorSha256 =
|
||||
"sha256-8mL467JTgtlmXKElDDtHRjkPpzvcB4G7qcPcLrA7Pzw=";
|
||||
|
||||
doCheck = false;
|
||||
nativeBuildInputs = with final.pkgs; [ pkg-config rustc cargo ];
|
||||
buildInputs = with final; [ ffmpeg ];
|
||||
};
|
||||
};
|
||||
|
@ -55,7 +54,10 @@
|
|||
|
||||
defaultApp = self.apps."${system}".musicutil;
|
||||
|
||||
devShell = pkgs.mkShell { buildInputs = with pkgs; [ go ffmpeg ]; };
|
||||
devShell = pkgs.mkShell {
|
||||
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
|
||||
buildInputs = with pkgs; [ rustc cargo rust-analyzer rustfmt ];
|
||||
};
|
||||
|
||||
lib = pkgs.musicutil.lib;
|
||||
});
|
||||
|
|
30
go.mod
30
go.mod
|
@ -1,30 +0,0 @@
|
|||
module gitlab.com/ChaotiCryptidz/musicutil
|
||||
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/akamensky/argparse v1.3.1
|
||||
github.com/cespare/xxhash v1.1.0
|
||||
github.com/dhowden/tag v0.0.0-20201120070457-d52dcb253c63
|
||||
github.com/rs/zerolog v1.26.1
|
||||
github.com/spf13/viper v1.10.1
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/fsnotify/fsnotify v1.5.1 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/kr/pretty v0.3.0 // indirect
|
||||
github.com/magiconair/properties v1.8.5 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.3 // indirect
|
||||
github.com/pelletier/go-toml v1.9.4 // indirect
|
||||
github.com/spf13/afero v1.6.0 // indirect
|
||||
github.com/spf13/cast v1.4.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/subosito/gotenv v1.2.0 // indirect
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||
gopkg.in/ini.v1 v1.66.2 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
784
go.sum
784
go.sum
|
@ -1,784 +0,0 @@
|
|||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
|
||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
|
||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
|
||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
|
||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
|
||||
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
|
||||
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
|
||||
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
|
||||
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
|
||||
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
|
||||
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
|
||||
cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||
cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY=
|
||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
|
||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
|
||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
|
||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/akamensky/argparse v1.3.1 h1:kP6+OyvR0fuBH6UhbE6yh/nskrDEIQgEA1SUXDPjx4g=
|
||||
github.com/akamensky/argparse v1.3.1/go.mod h1:S5kwC7IuDcEr5VeXtGPRVZ5o/FdhcMlQz4IZQuw64xA=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
|
||||
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dhowden/tag v0.0.0-20201120070457-d52dcb253c63 h1:/u5RVRk3Nh7Zw1QQnPtUH5kzcc8JmSSRpHSlGU/zGTE=
|
||||
github.com/dhowden/tag v0.0.0-20201120070457-d52dcb253c63/go.mod h1:SniNVYuaD1jmdEEvi+7ywb1QFR7agjeTdGKyFb0p7Rw=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
|
||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||
github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
|
||||
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
|
||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
|
||||
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
|
||||
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
||||
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc=
|
||||
github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||
github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4=
|
||||
github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
|
||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
|
||||
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
|
||||
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
|
||||
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
|
||||
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/pkg/errors v0.8.0/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/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
|
||||
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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
|
||||
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
|
||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
|
||||
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
|
||||
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM=
|
||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
|
||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
|
||||
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk=
|
||||
github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||
go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
|
||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
|
||||
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/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-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
|
||||
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/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-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk=
|
||||
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/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.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
|
||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
|
||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
|
||||
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
|
||||
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
|
||||
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
|
||||
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
|
||||
google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
|
||||
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
|
||||
google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
|
||||
google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU=
|
||||
google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
|
||||
google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
|
||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
|
||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
|
||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
||||
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
|
||||
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
|
||||
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
|
||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
|
||||
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
58
main.go
58
main.go
|
@ -1,58 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/commands/copy"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/commands/genhtml"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/commands/process"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/commands/transcode"
|
||||
|
||||
_ "gitlab.com/ChaotiCryptidz/musicutil/config"
|
||||
_ "gitlab.com/ChaotiCryptidz/musicutil/utils/transcoder"
|
||||
|
||||
"github.com/akamensky/argparse"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
|
||||
log_level := viper.GetString("log_level")
|
||||
if log_level == "info" {
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
} else if log_level == "debug" {
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
} else {
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
}
|
||||
|
||||
parser := argparse.NewParser("musicutil", "A tool for organising a music library and more.")
|
||||
|
||||
process_cmd, process_cmd_args := process.RegisterProcessCommand(parser)
|
||||
transcode_cmd, transcode_cmd_args := transcode.RegisterTranscodeCommand(parser)
|
||||
genhtml_cmd, genhtml_cmd_args := genhtml.RegisterGenHTMLCommand(parser)
|
||||
copy_cmd, copy_cmd_args := copy.RegisterCopyCommand(parser)
|
||||
|
||||
if err := parser.Parse(os.Args); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if process_cmd.Happened() {
|
||||
process.NewProcessCommand(process_cmd_args).Run()
|
||||
}
|
||||
|
||||
if transcode_cmd.Happened() {
|
||||
transcode.NewTranscodeCommand(transcode_cmd_args).Run()
|
||||
}
|
||||
|
||||
if genhtml_cmd.Happened() {
|
||||
genhtml.NewGenHTMLCommand(genhtml_cmd_args).Run()
|
||||
}
|
||||
|
||||
if copy_cmd.Happened() {
|
||||
copy.NewCopyCommand(copy_cmd_args).Run()
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package meta
|
||||
|
||||
var ffmpeg_path = "ffmpeg"
|
||||
var ffprobe_path = "ffprobe"
|
68
src/args/mod.rs
Normal file
68
src/args/mod.rs
Normal file
|
@ -0,0 +1,68 @@
|
|||
use clap::{Args, Parser, Subcommand};
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
#[clap()]
|
||||
pub struct CLIArgs {
|
||||
#[clap(subcommand)]
|
||||
pub command: Option<Commands>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Commands {
|
||||
Process(ProcessCommandArgs),
|
||||
Genhtml(GenHTMLCommandArgs),
|
||||
Transcode(TranscodeCommandArgs),
|
||||
Copy(CopyCommandArgs),
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct ProcessCommandArgs {
|
||||
#[clap(value_parser)]
|
||||
pub source: String,
|
||||
#[clap(long, value_parser)]
|
||||
pub dry_run: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct GenHTMLCommandArgs {
|
||||
#[clap(value_parser)]
|
||||
pub source: String,
|
||||
#[clap(value_parser)]
|
||||
pub dest: String,
|
||||
#[clap(long, value_parser, default_value = "musicutil")]
|
||||
pub title: String,
|
||||
#[clap(long, value_parser, default_value = "generated by musicutil")]
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct TranscodeCommandArgs {
|
||||
#[clap(value_parser)]
|
||||
pub source: String,
|
||||
#[clap(value_parser)]
|
||||
pub dest: String,
|
||||
#[clap(long, value_parser)]
|
||||
pub transcode_preset: Option<String>,
|
||||
#[clap(long, value_parser)]
|
||||
pub transcode_config: Option<String>,
|
||||
#[clap(long, value_parser)]
|
||||
pub ignore_extension: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Args)]
|
||||
pub struct CopyCommandArgs {
|
||||
#[clap(value_parser)]
|
||||
pub source: String,
|
||||
#[clap(value_parser)]
|
||||
pub dest: String,
|
||||
#[clap(long, value_parser)]
|
||||
pub transcode_preset: Option<String>,
|
||||
#[clap(long, value_parser)]
|
||||
pub transcode_config: Option<String>,
|
||||
#[clap(long, value_parser)]
|
||||
pub threads: Option<u32>,
|
||||
#[clap(long, value_parser)]
|
||||
pub no_skip_existing: bool,
|
||||
#[clap(long, value_parser)]
|
||||
pub single_directory: bool,
|
||||
}
|
198
src/commands/copy.rs
Normal file
198
src/commands/copy.rs
Normal file
|
@ -0,0 +1,198 @@
|
|||
use std::{
|
||||
collections::HashMap,
|
||||
fs,
|
||||
path::PathBuf,
|
||||
str::FromStr,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
use crossbeam::scope;
|
||||
|
||||
use crate::{
|
||||
args::{CLIArgs, CopyCommandArgs},
|
||||
types::File,
|
||||
utils::{
|
||||
scan_for_music,
|
||||
tag_extractor::extract_tags_from_file,
|
||||
transcoder::{
|
||||
transcode_presets::transcode_preset_or_config, transcoder::transcode,
|
||||
types::TranscodeConfig,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
pub fn copy_command(
|
||||
_args: &CLIArgs,
|
||||
copy_args: &CopyCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("Scanning For Music");
|
||||
let mut files = scan_for_music(©_args.source)?;
|
||||
|
||||
println!("Extracting Tags");
|
||||
for file in files.iter_mut() {
|
||||
println!("Extracting tags from: {:?}", file.join_path_from_source());
|
||||
|
||||
let tags = extract_tags_from_file(file.to_owned())?;
|
||||
file.tags = tags;
|
||||
}
|
||||
|
||||
if copy_args.single_directory {
|
||||
println!("Checking for Duplicates");
|
||||
let mut seen: HashMap<String, bool> = HashMap::new();
|
||||
let mut dupes: Vec<String> = Vec::new();
|
||||
for file in files.iter() {
|
||||
let filename = file.join_filename();
|
||||
if seen.contains_key(&filename) {
|
||||
dupes.push(filename);
|
||||
} else {
|
||||
seen.insert(filename, true);
|
||||
}
|
||||
}
|
||||
|
||||
if dupes.iter().count() > 0 {
|
||||
panic!("Duplicates Found: {}", dupes.join(","))
|
||||
}
|
||||
}
|
||||
|
||||
if !copy_args.single_directory {
|
||||
println!("Creating Directories");
|
||||
|
||||
let mut directories: Vec<String> = Vec::new();
|
||||
for file in files.iter() {
|
||||
if !directories.contains(&file.path_from_source) {
|
||||
directories.push(file.path_from_source.clone());
|
||||
}
|
||||
}
|
||||
for directory in directories.iter() {
|
||||
fs::create_dir_all(
|
||||
PathBuf::from_str(copy_args.dest.as_str())
|
||||
.unwrap()
|
||||
.join(directory),
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
if copy_args
|
||||
.transcode_preset
|
||||
.as_ref()
|
||||
.unwrap_or(&"".to_string())
|
||||
== "copy"
|
||||
{
|
||||
println!("Copying Files Into Dest");
|
||||
copy_files(&files, copy_args)?;
|
||||
} else {
|
||||
println!("Transcoding Files");
|
||||
transcode_files(&files, copy_args)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn copy_files(
|
||||
files: &Vec<File>,
|
||||
copy_args: &CopyCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
for file in files.iter() {
|
||||
let from_path = file.join_path_to();
|
||||
|
||||
let to_path_dest = PathBuf::from_str(copy_args.dest.as_str()).unwrap();
|
||||
let to_path = match copy_args.single_directory {
|
||||
true => to_path_dest.join(file.join_filename()),
|
||||
false => to_path_dest
|
||||
.join(file.path_from_source.clone())
|
||||
.join(file.join_filename()),
|
||||
};
|
||||
let to_path_string = to_path.as_os_str().to_str().unwrap().to_string();
|
||||
|
||||
if !copy_args.no_skip_existing && to_path.exists() {
|
||||
println!(
|
||||
"Skipping {} as already exists in destination",
|
||||
to_path_string
|
||||
);
|
||||
} else {
|
||||
println!("Copying {} to {}", from_path, to_path_string);
|
||||
fs::copy(from_path, to_path)?;
|
||||
}
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
fn transcode_file(
|
||||
file: &File,
|
||||
copy_args: &CopyCommandArgs,
|
||||
config: TranscodeConfig,
|
||||
is_threaded: bool,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let new_filename_full: String = match config.file_extension.clone() {
|
||||
Some(ext) => format!("{}.{}", file.filename, ext),
|
||||
None => {
|
||||
panic!("file_extension is required in custom transcode configs");
|
||||
}
|
||||
};
|
||||
|
||||
let to_path_dest = PathBuf::from_str(copy_args.dest.as_str()).unwrap();
|
||||
let to_path = match copy_args.single_directory {
|
||||
true => to_path_dest.join(new_filename_full),
|
||||
false => to_path_dest
|
||||
.join(file.path_from_source.clone())
|
||||
.join(new_filename_full),
|
||||
};
|
||||
let to_path_string = to_path.as_os_str().to_str().unwrap().to_string();
|
||||
|
||||
if !copy_args.no_skip_existing && to_path.exists() {
|
||||
println!(
|
||||
"Skipping transcode for {} as file already exists",
|
||||
to_path_string
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
println!("Transcoding {}", to_path_string);
|
||||
transcode(file.to_owned(), to_path_string.clone(), config, None)?;
|
||||
if is_threaded {
|
||||
println!("Finished Transcoding {}", to_path_string);
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
fn transcode_files(
|
||||
files: &Vec<File>,
|
||||
copy_args: &CopyCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let transcode_config = transcode_preset_or_config(
|
||||
copy_args.transcode_preset.clone(),
|
||||
copy_args.transcode_config.clone(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
if copy_args.threads.is_some() && copy_args.threads.unwrap() > 1 {
|
||||
let jobs: Arc<Mutex<Vec<File>>> = Arc::new(Mutex::new(files.clone()));
|
||||
let copy_args_arc = Arc::new(copy_args.clone());
|
||||
let transcode_config_arc = Arc::new(transcode_config);
|
||||
|
||||
scope(|s| {
|
||||
for _ in 0..copy_args.threads.unwrap() {
|
||||
s.spawn(|_| loop {
|
||||
let job = jobs.lock().unwrap().pop().unwrap().clone();
|
||||
let result = transcode_file(
|
||||
&job,
|
||||
©_args_arc,
|
||||
transcode_config_arc.as_ref().clone(),
|
||||
true,
|
||||
);
|
||||
if result.is_err() {
|
||||
panic!("Error Transcoding: {}", result.unwrap_err())
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.expect("threads haunted");
|
||||
} else {
|
||||
for file in files.iter() {
|
||||
transcode_file(file, copy_args, transcode_config.clone(), false)?;
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
144
src/commands/genhtml.rs
Normal file
144
src/commands/genhtml.rs
Normal file
|
@ -0,0 +1,144 @@
|
|||
use crate::args::CLIArgs;
|
||||
use crate::args::GenHTMLCommandArgs;
|
||||
use crate::types::File;
|
||||
use crate::utils::scan_for_music;
|
||||
use crate::utils::tag_extractor::extract_tags_from_file;
|
||||
use std::io::Write;
|
||||
|
||||
use html_escape::encode_text;
|
||||
|
||||
fn table_for_files(files: Vec<File>, includes_path: bool) -> String {
|
||||
let mut html_content = String::new();
|
||||
let mut path_head = String::new();
|
||||
if includes_path {
|
||||
path_head.push_str("<th>Path</th>")
|
||||
}
|
||||
|
||||
html_content.push_str(
|
||||
format!(
|
||||
"
|
||||
<table class=\"pure-table pure-table-horizontal\">
|
||||
<thead>
|
||||
<tr>
|
||||
{}
|
||||
<th>Title</th>
|
||||
<th>Artist</th>
|
||||
<th>Format</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
",
|
||||
path_head
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
let mut is_odd = true;
|
||||
for file in files.iter() {
|
||||
let td_class = match is_odd {
|
||||
true => "pure-table-odd",
|
||||
false => "pure-table-even",
|
||||
};
|
||||
|
||||
let data_title = encode_text(&file.tags.title);
|
||||
let data_artist = encode_text(&file.tags.artist);
|
||||
let data_extension = encode_text(&file.extension);
|
||||
|
||||
let mut path_data = String::new();
|
||||
if includes_path {
|
||||
path_data
|
||||
.push_str(format!("<td>{}</td>", encode_text(&file.path_from_source)).as_str());
|
||||
}
|
||||
html_content.push_str(
|
||||
format!(
|
||||
"
|
||||
<tr class=\"{}\">
|
||||
{}
|
||||
<td>{}</td>
|
||||
<td>{}</td>
|
||||
<td>{}</td>
|
||||
</tr>
|
||||
",
|
||||
td_class, path_data, data_title, data_artist, data_extension
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
is_odd = !is_odd;
|
||||
}
|
||||
|
||||
html_content.push_str(
|
||||
"
|
||||
</tbody>
|
||||
</table>
|
||||
",
|
||||
);
|
||||
return html_content;
|
||||
}
|
||||
|
||||
pub fn genhtml_command(
|
||||
_args: &CLIArgs,
|
||||
genhtml_args: &GenHTMLCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("Scanning For Music");
|
||||
let mut files = scan_for_music(&genhtml_args.source)?;
|
||||
|
||||
println!("Extracting Tags");
|
||||
for file in files.iter_mut() {
|
||||
println!("Extracting tags from: {:?}", file.join_path_from_source());
|
||||
|
||||
let tags = extract_tags_from_file(file.to_owned())?;
|
||||
file.tags = tags;
|
||||
}
|
||||
|
||||
files.sort_by(|a, b| {
|
||||
if a.path_from_source != b.path_from_source {
|
||||
return a.path_from_source.cmp(&b.path_from_source);
|
||||
}
|
||||
if a.tags.title != b.tags.title {
|
||||
return a.tags.title.cmp(&b.tags.title);
|
||||
}
|
||||
return a.tags.artist.cmp(&b.tags.artist);
|
||||
});
|
||||
|
||||
let mut html_content = String::new();
|
||||
html_content.push_str(
|
||||
format!(
|
||||
"
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
|
||||
<link rel=\"stylesheet\" href=\"https://unpkg.com/purecss@2.0.6/build/pure-min.css\">
|
||||
<title>{}</title>
|
||||
<meta property=\"og:title\" content=\"{}\" />
|
||||
<meta property=\"og:description\" content=\"{}\" />
|
||||
</head>
|
||||
<body>
|
||||
",
|
||||
encode_text(&genhtml_args.title),
|
||||
encode_text(&genhtml_args.title),
|
||||
encode_text(&genhtml_args.description)
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
|
||||
html_content.push_str(&table_for_files(files, true));
|
||||
html_content.push_str("</body></html>");
|
||||
|
||||
let file_path = std::path::PathBuf::from(genhtml_args.dest.as_str()).join("index.html");
|
||||
let html_index_file = std::fs::File::create(file_path);
|
||||
match html_index_file {
|
||||
Ok(mut file) => match file.write_all(html_content.as_bytes()) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
panic!("Could not write html file: {}", e);
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
panic!("Could not create HTML file: {}", e);
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
4
src/commands/mod.rs
Normal file
4
src/commands/mod.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
pub mod copy;
|
||||
pub mod genhtml;
|
||||
pub mod process;
|
||||
pub mod transcode;
|
82
src/commands/process.rs
Normal file
82
src/commands/process.rs
Normal file
|
@ -0,0 +1,82 @@
|
|||
use crate::args::CLIArgs;
|
||||
use crate::args::ProcessCommandArgs;
|
||||
use crate::types::File;
|
||||
use crate::utils::ascii_reduce::reduce_to_ascii;
|
||||
use crate::utils::scan_for_music;
|
||||
use crate::utils::tag_extractor::extract_tags_from_file;
|
||||
|
||||
fn rename_file(_args: &CLIArgs, process_args: &ProcessCommandArgs, file: &mut File) {
|
||||
let title = &file.tags.title;
|
||||
let artist = &file.tags.artist;
|
||||
|
||||
let replace_char = "_".to_string();
|
||||
|
||||
// Step 1: Remove Newlines
|
||||
let title = title.replace("\n", "");
|
||||
let artist = artist.replace("\n", "");
|
||||
|
||||
// Step 2: Strip ASCII
|
||||
let title = &reduce_to_ascii(title.clone()).clone();
|
||||
let artist = &reduce_to_ascii(artist.clone()).clone();
|
||||
|
||||
// Step 3: Remove File Seperators
|
||||
let title = title.replace("\\", &replace_char);
|
||||
let title = title.replace("/", &replace_char);
|
||||
let artist = artist.replace("\\", &replace_char);
|
||||
let artist = artist.replace("/", &replace_char);
|
||||
|
||||
// Step 4: Join Filename
|
||||
let filename = format!("{} - {}", artist, title);
|
||||
|
||||
if filename == file.filename {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 5: Make new File with filename set
|
||||
let mut new_file = file.clone();
|
||||
new_file.filename = filename.clone();
|
||||
|
||||
// Step 6: Rename File
|
||||
println!("Renaming File from {} to {}", file.filename, filename);
|
||||
if !process_args.dry_run {
|
||||
if std::path::Path::new(&new_file.join_path_to()).exists() {
|
||||
panic!(
|
||||
"Refusing to rename {} to {}, please retag to be distinct",
|
||||
&file.join_filename(),
|
||||
&new_file.join_filename()
|
||||
);
|
||||
} else {
|
||||
let err = std::fs::rename(&file.join_path_to(), &new_file.join_path_to());
|
||||
if err.is_err() {
|
||||
panic!("Could not rename {:?}", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !process_args.dry_run {
|
||||
file.filename = filename;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_command(
|
||||
args: &CLIArgs,
|
||||
process_args: &ProcessCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("Scanning For Music");
|
||||
let mut files = scan_for_music(&process_args.source)?;
|
||||
|
||||
println!("Extracting Tags");
|
||||
for file in files.iter_mut() {
|
||||
println!("Extracting tags from: {:?}", file.join_path_from_source());
|
||||
|
||||
let tags = extract_tags_from_file(file.to_owned())?;
|
||||
file.tags = tags;
|
||||
}
|
||||
|
||||
println!("Renaming Files");
|
||||
for file in files.iter_mut() {
|
||||
rename_file(args, process_args, file);
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
}
|
66
src/commands/transcode.rs
Normal file
66
src/commands/transcode.rs
Normal file
|
@ -0,0 +1,66 @@
|
|||
use std::sync::mpsc;
|
||||
use std::thread;
|
||||
|
||||
use crate::args::CLIArgs;
|
||||
use crate::args::TranscodeCommandArgs;
|
||||
use crate::types::File;
|
||||
use crate::utils::transcoder::transcode_presets::transcode_preset_or_config;
|
||||
use crate::utils::transcoder::transcoder::transcode;
|
||||
|
||||
pub fn transcode_command(
|
||||
_args: &CLIArgs,
|
||||
transcode_args: &TranscodeCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("Transcoding");
|
||||
let input_file = File::from_path("".to_string(), transcode_args.source.clone());
|
||||
let output_file = File::from_path("".to_string(), transcode_args.dest.clone());
|
||||
|
||||
let transcode_config = transcode_preset_or_config(
|
||||
transcode_args.transcode_preset.clone(),
|
||||
transcode_args.transcode_config.clone(),
|
||||
);
|
||||
if transcode_config.is_err() {
|
||||
panic!("Please provide Transcode Preset/Config");
|
||||
}
|
||||
let transcode_config = transcode_config.unwrap();
|
||||
|
||||
if !transcode_args.ignore_extension {
|
||||
if transcode_config.file_extension.is_some() {
|
||||
if transcode_config.file_extension.as_ref().unwrap() != &output_file.extension {
|
||||
panic!(
|
||||
concat!(
|
||||
"{} is not the recommended ",
|
||||
"extension for specified transcode config ",
|
||||
"please change it to {} ",
|
||||
"or run with --ignore-extension"
|
||||
),
|
||||
output_file.extension,
|
||||
transcode_config.file_extension.as_ref().unwrap()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let (tx, rx): (mpsc::Sender<String>, mpsc::Receiver<String>) = mpsc::channel();
|
||||
let child = thread::spawn(move || loop {
|
||||
let progress = rx.recv();
|
||||
if progress.is_err() {
|
||||
break;
|
||||
} else {
|
||||
let progress_str = progress.unwrap();
|
||||
println!("Transcode Progress: {}", progress_str);
|
||||
}
|
||||
});
|
||||
|
||||
transcode(
|
||||
input_file,
|
||||
transcode_args.dest.clone(),
|
||||
transcode_config,
|
||||
Some(tx),
|
||||
)?;
|
||||
child.join().expect("oops! the child thread panicked");
|
||||
|
||||
println!("Transcode Finished");
|
||||
|
||||
return Ok(());
|
||||
}
|
37
src/config/mod.rs
Normal file
37
src/config/mod.rs
Normal file
|
@ -0,0 +1,37 @@
|
|||
use directories_next::BaseDirs;
|
||||
use serde::Deserialize;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct Config {
|
||||
#[serde(with = "serde_with::rust::display_fromstr")]
|
||||
pub log_level: log::Level,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
log_level: log::Level::from_str("info").unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_config() -> Result<Config, Box<dyn std::error::Error>> {
|
||||
if let Some(base_dirs) = BaseDirs::new() {
|
||||
let config_dir = base_dirs.config_dir();
|
||||
|
||||
let config_file = std::fs::File::open(config_dir.join("musicutil.yaml"));
|
||||
if config_file.is_err() {
|
||||
return Ok(Config::default());
|
||||
}
|
||||
|
||||
let config: Result<Config, serde_yaml::Error> =
|
||||
serde_yaml::from_reader(config_file.unwrap());
|
||||
match config {
|
||||
Ok(conf) => return Ok(conf),
|
||||
Err(err) => return Err(Box::new(err)),
|
||||
}
|
||||
}
|
||||
|
||||
return Ok(Config::default());
|
||||
}
|
40
src/main.rs
Normal file
40
src/main.rs
Normal file
|
@ -0,0 +1,40 @@
|
|||
//use crate::config::load_config;
|
||||
//use crate::utils::ascii_reduce::reduce_to_ascii;
|
||||
//use crate::types::file_from_path;
|
||||
use crate::args::{CLIArgs, Commands};
|
||||
use crate::commands::genhtml::genhtml_command;
|
||||
use crate::commands::process::process_command;
|
||||
use crate::commands::transcode::transcode_command;
|
||||
|
||||
use clap::Parser;
|
||||
use commands::copy::copy_command;
|
||||
pub mod args;
|
||||
pub mod commands;
|
||||
pub mod config;
|
||||
pub mod meta;
|
||||
pub mod types;
|
||||
pub mod utils;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let cli = CLIArgs::parse();
|
||||
|
||||
match cli.command.as_ref() {
|
||||
Some(Commands::Process(process_args)) => {
|
||||
process_command(&cli, process_args)?;
|
||||
}
|
||||
Some(Commands::Genhtml(genhtml_args)) => {
|
||||
genhtml_command(&cli, genhtml_args)?;
|
||||
}
|
||||
Some(Commands::Transcode(transcode_args)) => {
|
||||
transcode_command(&cli, transcode_args)?;
|
||||
}
|
||||
Some(Commands::Copy(copy_args)) => {
|
||||
copy_command(&cli, copy_args)?;
|
||||
}
|
||||
None => {
|
||||
panic!("please provide a subcommand");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
2
src/meta/mod.rs
Normal file
2
src/meta/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
pub static FFMPEG: &'static str = "ffmpeg";
|
||||
pub static FFPROBE: &'static str = "ffprobe";
|
72
src/types/mod.rs
Normal file
72
src/types/mod.rs
Normal file
|
@ -0,0 +1,72 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Tags {
|
||||
pub title: String,
|
||||
pub artist: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct File {
|
||||
pub filename: String,
|
||||
pub extension: String,
|
||||
|
||||
pub path_to: String,
|
||||
pub path_from_source: String,
|
||||
pub tags: Tags,
|
||||
}
|
||||
|
||||
impl File {
|
||||
pub fn from_path(source_dir: String, full_path: String) -> File {
|
||||
let full_file_path = PathBuf::from(&source_dir).join(PathBuf::from(full_path));
|
||||
let filename = full_file_path
|
||||
.file_stem()
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_string();
|
||||
let extension = full_file_path
|
||||
.extension()
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_string();
|
||||
|
||||
let path_from_src = full_file_path.strip_prefix(&source_dir).unwrap();
|
||||
|
||||
let mut folder_path_from_src = path_from_src.to_path_buf();
|
||||
folder_path_from_src.pop();
|
||||
|
||||
let path_to = PathBuf::from(&source_dir).join(&folder_path_from_src);
|
||||
|
||||
return File {
|
||||
filename: filename,
|
||||
extension: extension,
|
||||
path_from_source: folder_path_from_src.into_os_string().into_string().unwrap(),
|
||||
path_to: path_to.into_os_string().into_string().unwrap(),
|
||||
tags: Tags {
|
||||
title: "".to_string(),
|
||||
artist: "".to_string(),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
pub fn join_filename(&self) -> String {
|
||||
return format!("{}.{}", self.filename, self.extension);
|
||||
}
|
||||
pub fn join_path_to(&self) -> String {
|
||||
return PathBuf::from(&self.path_to)
|
||||
.join(self.join_filename())
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.unwrap();
|
||||
}
|
||||
pub fn join_path_from_source(&self) -> String {
|
||||
return PathBuf::from(&self.path_from_source)
|
||||
.join(self.join_filename())
|
||||
.into_os_string()
|
||||
.into_string()
|
||||
.unwrap();
|
||||
}
|
||||
}
|
55
src/utils/ascii_reduce/mod.rs
Normal file
55
src/utils/ascii_reduce/mod.rs
Normal file
|
@ -0,0 +1,55 @@
|
|||
use lazy_static::lazy_static;
|
||||
use std::collections::HashMap;
|
||||
|
||||
const MAPPINGS_DATA: &str = include_str!("mappings.json");
|
||||
|
||||
lazy_static! {
|
||||
static ref MAPPINGS: HashMap<char, String> = {
|
||||
let data: HashMap<String, String> = serde_json::from_str(MAPPINGS_DATA).unwrap();
|
||||
|
||||
let mut replacement_map: HashMap<char, String> = HashMap::new();
|
||||
for (chr, repl) in &data {
|
||||
match chr.parse::<u32>() {
|
||||
Ok(n) => {
|
||||
let b = char::from_u32(n);
|
||||
if b.is_some() {
|
||||
replacement_map.insert(b.unwrap(), repl.to_string());
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
panic!(
|
||||
"mapping data broken, could not parse char {} with error {}",
|
||||
chr, e
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return replacement_map;
|
||||
};
|
||||
}
|
||||
|
||||
pub fn reduce_to_ascii(input: String) -> String {
|
||||
if input.is_ascii() {
|
||||
return input;
|
||||
}
|
||||
|
||||
let mut output = String::with_capacity(input.len());
|
||||
for c in input.chars() {
|
||||
if c.is_ascii() {
|
||||
output.push(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
match MAPPINGS.get(&c) {
|
||||
Some(replacement) => {
|
||||
output.push_str(replacement);
|
||||
}
|
||||
None => {
|
||||
output.push_str("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
38
src/utils/mod.rs
Normal file
38
src/utils/mod.rs
Normal file
|
@ -0,0 +1,38 @@
|
|||
use crate::types::File;
|
||||
use std::path::PathBuf;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub mod ascii_reduce;
|
||||
pub mod tag_extractor;
|
||||
pub mod transcoder;
|
||||
|
||||
pub fn is_valid_file_extension(file_path: &PathBuf) -> bool {
|
||||
let ext = file_path.extension().unwrap().to_str().unwrap().to_string();
|
||||
if ext == "mp3" {
|
||||
return true;
|
||||
} else if ext == "flac" {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
pub fn scan_for_music(src_dir: &String) -> Result<Vec<File>, Box<dyn std::error::Error>> {
|
||||
let mut files: Vec<File> = Vec::new();
|
||||
|
||||
for entry in WalkDir::new(&src_dir) {
|
||||
let entry = entry.unwrap();
|
||||
let entry_path = entry.into_path();
|
||||
if entry_path.is_dir() {
|
||||
continue;
|
||||
}
|
||||
if is_valid_file_extension(&entry_path) {
|
||||
let file = File::from_path(
|
||||
src_dir.clone(),
|
||||
entry_path.into_os_string().into_string().unwrap(),
|
||||
);
|
||||
files.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(files)
|
||||
}
|
21
src/utils/tag_extractor/mod.rs
Normal file
21
src/utils/tag_extractor/mod.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
use crate::types::{File, Tags};
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub fn extract_tags(file: String) -> Result<Tags, Box<dyn std::error::Error>> {
|
||||
let file_path = PathBuf::from(&file);
|
||||
let file_extension = file_path.extension().unwrap();
|
||||
|
||||
if file_extension == "mp3" || file_extension == "flac" {
|
||||
let tag = audiotags::Tag::new().read_from_path(file)?;
|
||||
return Ok(Tags {
|
||||
title: String::from(tag.title().unwrap()),
|
||||
artist: String::from(tag.artist().unwrap()),
|
||||
});
|
||||
}
|
||||
|
||||
panic!("oops")
|
||||
}
|
||||
|
||||
pub fn extract_tags_from_file(file: File) -> Result<Tags, Box<dyn std::error::Error>> {
|
||||
return extract_tags(file.join_path_to());
|
||||
}
|
3
src/utils/transcoder/mod.rs
Normal file
3
src/utils/transcoder/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
pub mod transcode_presets;
|
||||
pub mod transcoder;
|
||||
pub mod types;
|
215
src/utils/transcoder/transcode_presets.rs
Normal file
215
src/utils/transcoder/transcode_presets.rs
Normal file
|
@ -0,0 +1,215 @@
|
|||
use lazy_static::lazy_static;
|
||||
use string_error::into_err;
|
||||
|
||||
use crate::utils::transcoder::types::Preset;
|
||||
use crate::utils::transcoder::types::PresetCategory;
|
||||
use crate::utils::transcoder::types::TranscodeConfig;
|
||||
|
||||
lazy_static! {
|
||||
#[derive(Debug)]
|
||||
pub static ref TRANSCODE_CONFIGS: Vec<PresetCategory> = {
|
||||
let mut preset_categories: Vec<PresetCategory> = Vec::new();
|
||||
|
||||
add_mp3_presets(&mut preset_categories);
|
||||
add_opus_presets(&mut preset_categories);
|
||||
add_vorbis_presets(&mut preset_categories);
|
||||
add_g726_presets(&mut preset_categories);
|
||||
add_speex_presets(&mut preset_categories);
|
||||
add_flac_preset(&mut preset_categories);
|
||||
add_wav_preset(&mut preset_categories);
|
||||
|
||||
return preset_categories;
|
||||
};
|
||||
}
|
||||
|
||||
fn add_mp3_presets(preset_categories: &mut Vec<PresetCategory>) {
|
||||
let mut presets: Vec<Preset> = Vec::new();
|
||||
for bitrate in [
|
||||
8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320,
|
||||
] {
|
||||
presets.push(Preset {
|
||||
name: format!("mp3-{}k", bitrate).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("mp3".to_string()),
|
||||
encoder: Some("libmp3lame".to_string()),
|
||||
container: Some("mp3".to_string()),
|
||||
bitrate: Some(format!("{}k", bitrate).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
for quality in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] {
|
||||
presets.push(Preset {
|
||||
name: format!("mp3-v{}", quality).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("mp3".to_string()),
|
||||
encoder: Some("libmp3lame".to_string()),
|
||||
container: Some("mp3".to_string()),
|
||||
quality: Some(format!("{}", quality).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "mp3".to_string(),
|
||||
presets: presets,
|
||||
});
|
||||
}
|
||||
|
||||
fn add_opus_presets(preset_categories: &mut Vec<PresetCategory>) {
|
||||
let mut presets: Vec<Preset> = Vec::new();
|
||||
for bitrate in [16, 24, 32, 64, 96, 128, 256] {
|
||||
presets.push(Preset {
|
||||
name: format!("opus-{}k", bitrate).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("opus".to_string()),
|
||||
encoder: Some("libopus".to_string()),
|
||||
container: Some("ogg".to_string()),
|
||||
bitrate: Some(format!("{}k", bitrate).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "opus".to_string(),
|
||||
presets: presets,
|
||||
});
|
||||
}
|
||||
|
||||
fn add_vorbis_presets(preset_categories: &mut Vec<PresetCategory>) {
|
||||
let mut presets: Vec<Preset> = Vec::new();
|
||||
for quality in [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] {
|
||||
presets.push(Preset {
|
||||
name: format!("vorbis-v{}", quality).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("ogg".to_string()),
|
||||
encoder: Some("libvorbis".to_string()),
|
||||
container: Some("ogg".to_string()),
|
||||
quality: Some(format!("{}", quality).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "vorbis".to_string(),
|
||||
presets: presets,
|
||||
});
|
||||
}
|
||||
|
||||
fn add_g726_presets(preset_categories: &mut Vec<PresetCategory>) {
|
||||
let mut presets: Vec<Preset> = Vec::new();
|
||||
for bitrate in [16, 24, 32, 64, 96, 128, 256] {
|
||||
presets.push(Preset {
|
||||
name: format!("g726-{}k", bitrate).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("mka".to_string()),
|
||||
encoder: Some("g726".to_string()),
|
||||
container: Some("matroska".to_string()),
|
||||
sample_rate: Some("8000".to_string()),
|
||||
channels: Some("1".to_string()),
|
||||
bitrate: Some(format!("{}k", bitrate).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "g726".to_string(),
|
||||
presets: presets,
|
||||
});
|
||||
}
|
||||
|
||||
fn add_speex_presets(preset_categories: &mut Vec<PresetCategory>) {
|
||||
let mut presets: Vec<Preset> = Vec::new();
|
||||
for quality in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] {
|
||||
presets.push(Preset {
|
||||
name: format!("speex-q{}", quality).to_string(),
|
||||
config: TranscodeConfig {
|
||||
file_extension: Some("ogg".to_string()),
|
||||
encoder: Some("libspeex".to_string()),
|
||||
container: Some("ogg".to_string()),
|
||||
quality: Some(format!("{}", quality).to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "speex".to_string(),
|
||||
presets: presets,
|
||||
});
|
||||
}
|
||||
|
||||
fn add_flac_preset(preset_categories: &mut Vec<PresetCategory>) {
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "flac".to_string(),
|
||||
presets: Vec::from([Preset {
|
||||
name: "flac".to_string(),
|
||||
config: TranscodeConfig {
|
||||
encoder: Some("flac".to_string()),
|
||||
container: Some("flac".to_string()),
|
||||
file_extension: Some("flac".to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
}]),
|
||||
})
|
||||
}
|
||||
|
||||
fn add_wav_preset(preset_categories: &mut Vec<PresetCategory>) {
|
||||
preset_categories.push(PresetCategory {
|
||||
name: "wav".to_string(),
|
||||
presets: Vec::from([Preset {
|
||||
name: "wav".to_string(),
|
||||
config: TranscodeConfig {
|
||||
container: Some("wav".to_string()),
|
||||
file_extension: Some("wav".to_string()),
|
||||
..TranscodeConfig::default()
|
||||
},
|
||||
}]),
|
||||
})
|
||||
}
|
||||
|
||||
pub fn print_presets() {
|
||||
for category in TRANSCODE_CONFIGS.iter() {
|
||||
println!("Category {}:", category.name);
|
||||
for preset in category.presets.iter() {
|
||||
println!("- {}", preset.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_preset(name: String) -> Option<TranscodeConfig> {
|
||||
for category in TRANSCODE_CONFIGS.iter() {
|
||||
for preset in category.presets.iter() {
|
||||
if preset.name == name {
|
||||
return Some(preset.config.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
return None;
|
||||
}
|
||||
|
||||
pub fn transcode_preset_or_config(
|
||||
preset: Option<String>,
|
||||
config: Option<String>,
|
||||
) -> Result<TranscodeConfig, Box<dyn std::error::Error>> {
|
||||
if preset.is_some() {
|
||||
let preset_name = preset.unwrap().to_string();
|
||||
let preset_config = get_preset(preset_name);
|
||||
if preset_config.is_none() {
|
||||
return Err(into_err("invalid preset name".to_string()));
|
||||
} else {
|
||||
return Ok(preset_config.unwrap());
|
||||
}
|
||||
} else if config.is_some() {
|
||||
return Ok(TranscodeConfig::load(config.unwrap().to_string())?);
|
||||
} else {
|
||||
return Err(into_err(
|
||||
"please provide a transcode config or preset".to_string(),
|
||||
));
|
||||
}
|
||||
}
|
209
src/utils/transcoder/transcoder.rs
Normal file
209
src/utils/transcoder/transcoder.rs
Normal file
|
@ -0,0 +1,209 @@
|
|||
use std::{
|
||||
fs,
|
||||
io::{BufRead, BufReader, Seek, SeekFrom},
|
||||
process::Command,
|
||||
sync::mpsc::{self, Sender},
|
||||
thread::{self, JoinHandle},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use notify::{watcher, DebouncedEvent, RecursiveMode, Watcher};
|
||||
|
||||
use crate::types::File;
|
||||
use serde::Deserialize;
|
||||
use string_error::static_err;
|
||||
|
||||
use super::types::TranscodeConfig;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct FFProbeOutput {
|
||||
pub format: FFProbeFormat,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct FFProbeFormat {
|
||||
pub duration: String,
|
||||
}
|
||||
|
||||
fn get_file_length_milliseconds(filename: String) -> Result<u64, Box<dyn std::error::Error>> {
|
||||
let output = Command::new(crate::meta::FFPROBE)
|
||||
.args([
|
||||
"-v",
|
||||
"quiet",
|
||||
"-print_format",
|
||||
"json",
|
||||
"-show_format",
|
||||
filename.as_str(),
|
||||
])
|
||||
.output()?;
|
||||
|
||||
if !output.status.success() {
|
||||
print!("{:?}", String::from_utf8(output.stderr).unwrap());
|
||||
return Err(static_err("FFprobe Crashed"));
|
||||
}
|
||||
|
||||
let output_str = String::from_utf8(output.stdout).unwrap();
|
||||
let ffprobe_out: FFProbeOutput = serde_json::from_str(output_str.as_str())?;
|
||||
|
||||
let duration_seconds = ffprobe_out.format.duration.parse::<f32>()?;
|
||||
return Ok((duration_seconds * 1000.0).round() as u64);
|
||||
}
|
||||
|
||||
fn ffprobe_duration_to_ms(duration: String) -> Result<u64, Box<dyn std::error::Error>> {
|
||||
let fields: Vec<&str> = duration.split(":").collect();
|
||||
let mut duration = Duration::from_nanos(0);
|
||||
|
||||
let hours = fields[0].parse::<u64>()?;
|
||||
duration += Duration::from_secs(hours * 60 * 60);
|
||||
|
||||
let minutes = fields[1].parse::<u64>()?;
|
||||
duration += Duration::from_secs(minutes * 60);
|
||||
|
||||
let seconds = fields[1].parse::<f64>()?;
|
||||
duration += Duration::from_millis((seconds * 1000.0) as u64);
|
||||
|
||||
return Ok(duration.as_millis() as u64);
|
||||
}
|
||||
|
||||
pub fn progress_monitor(
|
||||
source_filename: String,
|
||||
sender_base: &Sender<String>,
|
||||
) -> Result<(String, JoinHandle<()>), Box<dyn std::error::Error>> {
|
||||
let total_length_millis = get_file_length_milliseconds(source_filename)?;
|
||||
|
||||
let tempdir = tempfile::tempdir()?;
|
||||
let file_path = tempdir.path().join("progress.log");
|
||||
let file_path_string = file_path.to_str().unwrap().to_string();
|
||||
fs::File::create(&file_path)?;
|
||||
|
||||
let sender = sender_base.clone();
|
||||
let child = thread::spawn(move || {
|
||||
let _ = &tempdir;
|
||||
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let mut watcher = watcher(tx, Duration::from_millis(100)).unwrap();
|
||||
watcher
|
||||
.watch(&file_path, RecursiveMode::NonRecursive)
|
||||
.unwrap();
|
||||
|
||||
let mut pos = 0;
|
||||
|
||||
'outer: loop {
|
||||
match rx.recv() {
|
||||
Ok(DebouncedEvent::Write(_)) => {
|
||||
let mut file = fs::File::open(&file_path).unwrap();
|
||||
file.seek(SeekFrom::Start(pos)).unwrap();
|
||||
|
||||
pos = file.metadata().unwrap().len();
|
||||
|
||||
let reader = BufReader::new(file);
|
||||
for line in reader.lines() {
|
||||
let ln = line.unwrap();
|
||||
|
||||
if ln == "progress=end" {
|
||||
break 'outer;
|
||||
}
|
||||
|
||||
if ln.starts_with("out_time=") {
|
||||
let out_time = ln.strip_prefix("out_time=").unwrap().to_string();
|
||||
let out_time_ms = ffprobe_duration_to_ms(out_time).unwrap();
|
||||
if sender
|
||||
.send(format!(
|
||||
"{:.2}%",
|
||||
((out_time_ms as f64 / total_length_millis as f64) * 100.0)
|
||||
))
|
||||
.is_err()
|
||||
{
|
||||
break 'outer;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(DebouncedEvent::NoticeRemove(_)) => {
|
||||
break 'outer;
|
||||
}
|
||||
Ok(_) => {}
|
||||
Err(_) => {
|
||||
break 'outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return Ok((file_path_string, child));
|
||||
}
|
||||
|
||||
pub fn transcode(
|
||||
file: File,
|
||||
dest: String,
|
||||
config: TranscodeConfig,
|
||||
progress_sender: Option<Sender<String>>,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut command_args: Vec<String> = Vec::new();
|
||||
command_args.extend(vec!["-y".to_string(), "-hide_banner".to_string()]);
|
||||
|
||||
command_args.extend(vec!["-i".to_string(), file.join_path_to()]);
|
||||
|
||||
if config.encoder.is_some() {
|
||||
command_args.extend(vec!["-c:a".to_string(), config.encoder.unwrap()]);
|
||||
}
|
||||
|
||||
if config.container.is_some() {
|
||||
command_args.extend(vec!["-f".to_string(), config.container.unwrap()]);
|
||||
}
|
||||
|
||||
if config.sample_rate.is_some() {
|
||||
command_args.extend(vec!["-ar".to_string(), config.sample_rate.unwrap()]);
|
||||
}
|
||||
|
||||
if config.channels.is_some() {
|
||||
command_args.extend(vec!["-ac".to_string(), config.channels.unwrap()]);
|
||||
}
|
||||
|
||||
if config.quality.is_some() {
|
||||
command_args.extend(vec!["-q:a".to_string(), config.quality.unwrap()]);
|
||||
}
|
||||
|
||||
if config.bitrate.is_some() {
|
||||
command_args.extend(vec!["-b:a".to_string(), config.bitrate.unwrap()]);
|
||||
}
|
||||
|
||||
command_args.push(dest);
|
||||
|
||||
let mut progress_thread: Option<JoinHandle<()>> = None;
|
||||
let mut progress_file: Option<String> = None;
|
||||
|
||||
if progress_sender.is_some() {
|
||||
let sender = progress_sender.as_ref().unwrap();
|
||||
let result = progress_monitor(file.join_path_to(), sender);
|
||||
if result.is_ok() {
|
||||
let res = result.unwrap();
|
||||
progress_thread = Some(res.1);
|
||||
progress_file = Some(res.0.clone());
|
||||
command_args.extend(vec!["-progress".to_string(), res.0, "-nostats".to_string()]);
|
||||
}
|
||||
}
|
||||
|
||||
let output = Command::new(crate::meta::FFMPEG)
|
||||
.args(command_args)
|
||||
.output()
|
||||
.expect("failed to execute process");
|
||||
|
||||
if progress_sender.is_some() {
|
||||
drop(progress_sender.unwrap());
|
||||
}
|
||||
if progress_thread.is_some() {
|
||||
fs::remove_file(progress_file.unwrap())?;
|
||||
progress_thread
|
||||
.unwrap()
|
||||
.join()
|
||||
.expect("thread couldn't join");
|
||||
}
|
||||
|
||||
if !output.status.success() {
|
||||
print!("{:?}", String::from_utf8(output.stderr).unwrap());
|
||||
return Err(static_err("FFmpeg Crashed"));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
47
src/utils/transcoder/types.rs
Normal file
47
src/utils/transcoder/types.rs
Normal file
|
@ -0,0 +1,47 @@
|
|||
use std::{fs::File, io::BufReader, path::PathBuf};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use string_error::static_err;
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Preset {
|
||||
pub name: String,
|
||||
pub config: TranscodeConfig,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct PresetCategory {
|
||||
pub name: String,
|
||||
pub presets: Vec<Preset>,
|
||||
}
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||
|
||||
pub struct TranscodeConfig {
|
||||
pub encoder: Option<String>,
|
||||
pub file_extension: Option<String>,
|
||||
pub container: Option<String>,
|
||||
pub bitrate: Option<String>,
|
||||
pub quality: Option<String>,
|
||||
pub sample_rate: Option<String>,
|
||||
pub channels: Option<String>,
|
||||
}
|
||||
|
||||
impl TranscodeConfig {
|
||||
pub fn load(path: String) -> Result<TranscodeConfig, Box<dyn std::error::Error>> {
|
||||
let path_buf = PathBuf::from(&path);
|
||||
let extension = path_buf.extension().unwrap();
|
||||
let file = File::open(path)?;
|
||||
let reader = BufReader::new(file);
|
||||
|
||||
if extension == "yml" || extension == "yaml" {
|
||||
let u: TranscodeConfig =
|
||||
serde_yaml::from_reader(reader).expect("error while reading yaml");
|
||||
return Ok(u);
|
||||
} else if extension == "json" {
|
||||
let u: TranscodeConfig =
|
||||
serde_json::from_reader(reader).expect("error while reading json");
|
||||
return Ok(u);
|
||||
}
|
||||
Err(static_err("Invalid File Extension"))
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Tags struct {
|
||||
Title string `json:"title"`
|
||||
Artist string `json:"artist"`
|
||||
}
|
||||
|
||||
func (tags *Tags) DeepCopy() *Tags {
|
||||
return &Tags{
|
||||
Title: tags.Title,
|
||||
Artist: tags.Artist,
|
||||
}
|
||||
}
|
||||
|
||||
type File struct {
|
||||
Filename string `json:"filename"`
|
||||
Extension string `json:"extension"`
|
||||
// The path to the actual file from current dir
|
||||
PathTo string `json:"path_to"`
|
||||
// The path of the file relative to the source directory
|
||||
PathFromSource string `json:"path_from_source"`
|
||||
Tags *Tags `json:"tags"`
|
||||
}
|
||||
|
||||
func FileFromPath(sourceDir string, fullPath string) *File {
|
||||
path_to := filepath.Dir(fullPath)
|
||||
path_from_src, _ := filepath.Rel(sourceDir, filepath.Dir(fullPath))
|
||||
filename := strings.TrimSuffix(path.Base(fullPath), path.Ext(fullPath))
|
||||
extension := strings.TrimPrefix(path.Ext(fullPath), ".")
|
||||
|
||||
return &File{
|
||||
PathTo: path_to,
|
||||
PathFromSource: path_from_src,
|
||||
Filename: filename,
|
||||
Extension: extension,
|
||||
Tags: &Tags{Title: "", Artist: ""},
|
||||
}
|
||||
}
|
||||
|
||||
func (f *File) JoinFilename() string {
|
||||
return fmt.Sprintf("%s.%s", f.Filename, f.Extension)
|
||||
}
|
||||
|
||||
func (f *File) JoinPathTo() string {
|
||||
return fmt.Sprintf("%s/%s", f.PathTo, f.JoinFilename())
|
||||
}
|
||||
|
||||
func (f *File) JoinPathFromSource() string {
|
||||
return fmt.Sprintf("%s/%s", f.PathFromSource, f.JoinFilename())
|
||||
}
|
||||
|
||||
func (f *File) DeepCopy() *File {
|
||||
return &File{
|
||||
Filename: f.Filename,
|
||||
Extension: f.Extension,
|
||||
PathTo: f.PathTo,
|
||||
PathFromSource: f.PathFromSource,
|
||||
Tags: f.Tags.DeepCopy(),
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package ascii_reduce
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
//go:embed mappings.json
|
||||
var mappingsData string
|
||||
|
||||
var Mappings map[rune]string
|
||||
|
||||
func init() {
|
||||
var mappings map[string]string
|
||||
|
||||
json.Unmarshal([]byte(mappingsData), &mappings)
|
||||
|
||||
Mappings = make(map[rune]string)
|
||||
|
||||
for key, value := range mappings {
|
||||
r, _ := strconv.Atoi(key)
|
||||
Mappings[rune(r)] = value
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package ascii_reduce
|
||||
|
||||
func getMapping(r rune) []rune {
|
||||
if replacement, ok := Mappings[r]; ok {
|
||||
return []rune(replacement)
|
||||
} else {
|
||||
return []rune("")
|
||||
}
|
||||
}
|
||||
|
||||
func Reduce(s string, replace_non_ascii_char string) string {
|
||||
runes := []rune(s)
|
||||
|
||||
isAllAscii := true
|
||||
for _, r := range runes {
|
||||
if r > 0x7e {
|
||||
isAllAscii = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if isAllAscii {
|
||||
return s
|
||||
}
|
||||
|
||||
newRunes := make([]rune, 0)
|
||||
|
||||
for _, sourceRune := range runes {
|
||||
mapped := getMapping(sourceRune)
|
||||
for _, replacedRune := range mapped {
|
||||
if replacedRune > 0x7e {
|
||||
replacedRune = []rune(replace_non_ascii_char)[0]
|
||||
}
|
||||
|
||||
newRunes = append(newRunes, replacedRune)
|
||||
}
|
||||
}
|
||||
|
||||
return string(newRunes)
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/utils/tag_extractor"
|
||||
)
|
||||
|
||||
func ExtractTags(file *types.File) (*types.Tags, error) {
|
||||
return tag_extractor.ExtractTags(file.JoinPathTo())
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
func isValidFileExtension(filePath string) bool {
|
||||
ext := strings.TrimPrefix(filepath.Ext(filePath), ".")
|
||||
if ext == "mp3" {
|
||||
return true
|
||||
} else if ext == "flac" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func ScanForMusic(srcDir string) ([]*types.File, error) {
|
||||
files := make([]*types.File, 0)
|
||||
|
||||
err := filepath.Walk(srcDir,
|
||||
func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !info.IsDir() && isValidFileExtension(path) {
|
||||
files = append(files, types.FileFromPath(
|
||||
srcDir,
|
||||
path,
|
||||
))
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return files, nil
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
package tag_cache
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/cespare/xxhash"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
type CacheData struct {
|
||||
FileHash uint64 `json:"file_hash"`
|
||||
FileTags *types.Tags `json:"file_tags"`
|
||||
}
|
||||
|
||||
type TagCache struct {
|
||||
// map of filename hash to file tags & file hash
|
||||
cache map[string]CacheData
|
||||
source_dir string
|
||||
settings *tagCacheSettings
|
||||
}
|
||||
|
||||
func get_cache_filename(source_dir string, settings *tagCacheSettings) string {
|
||||
if settings.CacheDir == "source_dir" {
|
||||
return source_dir + "/.tag_cache.json"
|
||||
} else {
|
||||
return settings.CacheDir + "/.tag_cache.json"
|
||||
}
|
||||
}
|
||||
|
||||
func NewTagCache(source_dir string) *TagCache {
|
||||
cache := &TagCache{}
|
||||
settings := getTagCacheSettings()
|
||||
cache.settings = settings
|
||||
cache.source_dir = source_dir
|
||||
cache.cache = make(map[string]CacheData)
|
||||
|
||||
if !settings.CacheEnabled {
|
||||
return cache
|
||||
}
|
||||
|
||||
cache_filename := get_cache_filename(source_dir, settings)
|
||||
|
||||
if _, err := os.Stat(cache_filename); err != nil {
|
||||
file, err := os.Create(cache_filename)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Could not create cache file")
|
||||
return cache
|
||||
}
|
||||
file.Write([]byte("{}"))
|
||||
file.Close()
|
||||
return cache
|
||||
} else {
|
||||
file, err := os.Open(cache_filename)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Could not open cache file")
|
||||
}
|
||||
|
||||
file_data, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
var cache_data map[string]CacheData
|
||||
|
||||
err = json.Unmarshal(file_data, &cache_data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
cache.cache = cache_data
|
||||
return cache
|
||||
}
|
||||
}
|
||||
|
||||
func getFileNameHash(filename string) string {
|
||||
filename_hash_bytes := sha1.Sum([]byte(filename))
|
||||
filename_hash := hex.EncodeToString(filename_hash_bytes[:])
|
||||
return filename_hash
|
||||
}
|
||||
|
||||
func getFileContentsHash(filename string) (uint64, error) {
|
||||
file_handle, err := os.Open(filename)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
contents_hasher := xxhash.New()
|
||||
if _, err := io.Copy(contents_hasher, file_handle); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
hash := contents_hasher.Sum64()
|
||||
return hash, nil
|
||||
}
|
||||
|
||||
func (tc *TagCache) IsCached(file *types.File) (*types.Tags, bool) {
|
||||
if !tc.settings.CacheEnabled {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
filename_hash := getFileNameHash(file.Filename)
|
||||
|
||||
// is not in cache at all
|
||||
if _, ok := tc.cache[filename_hash]; !ok {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
hash, err := getFileContentsHash(file.JoinPathTo())
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Could not hash file, skipping")
|
||||
return nil, false
|
||||
}
|
||||
|
||||
// is in cache
|
||||
if tc.cache[filename_hash].FileHash != hash {
|
||||
return nil, false
|
||||
} else {
|
||||
return tc.cache[filename_hash].FileTags, true
|
||||
}
|
||||
}
|
||||
|
||||
func (tc *TagCache) AddToCache(file *types.File, tags *types.Tags) {
|
||||
if !tc.settings.CacheEnabled {
|
||||
return
|
||||
}
|
||||
|
||||
filename_hash := getFileNameHash(file.Filename)
|
||||
hash, err := getFileContentsHash(file.JoinPathTo())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
tc.cache[filename_hash] = CacheData{
|
||||
FileHash: hash,
|
||||
FileTags: tags.DeepCopy(),
|
||||
}
|
||||
}
|
||||
|
||||
func (tc *TagCache) Close() {
|
||||
if !tc.settings.CacheEnabled {
|
||||
return
|
||||
}
|
||||
|
||||
cache_filename := get_cache_filename(tc.source_dir, tc.settings)
|
||||
|
||||
file, err := os.OpenFile(cache_filename, os.O_RDWR|os.O_CREATE, 0755)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
data, err := json.Marshal(tc.cache)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
_, err = file.Write(data)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package tag_cache
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
type tagCacheSettings struct {
|
||||
CacheEnabled bool
|
||||
CacheDir string
|
||||
}
|
||||
|
||||
func getTagCacheSettings() *tagCacheSettings {
|
||||
return &tagCacheSettings{
|
||||
CacheEnabled: viper.GetBool("cache"),
|
||||
CacheDir: viper.GetString("cache_dir"),
|
||||
}
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package tag_extractor
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
func tagsOrErr(tags *types.Tags) (*types.Tags, error) {
|
||||
if len(tags.Title) == 0 {
|
||||
return nil, errors.New("Could not extract title")
|
||||
}
|
||||
|
||||
if len(tags.Artist) == 0 {
|
||||
return nil, errors.New("Could not extract artist")
|
||||
}
|
||||
|
||||
return tags, nil
|
||||
}
|
||||
|
||||
func ExtractTags(path string) (*types.Tags, error) {
|
||||
// Do this in order of speed and preference
|
||||
// Maybe add some better logic in here at some point
|
||||
|
||||
file_extension := strings.TrimSuffix(filepath.Ext(path), ".")
|
||||
|
||||
var tags *types.Tags
|
||||
var err error = nil
|
||||
|
||||
if file_extension == "mp3" || file_extension == "flac" {
|
||||
tags, err = TaglibExtractor(path)
|
||||
if err == nil {
|
||||
return tagsOrErr(tags)
|
||||
}
|
||||
}
|
||||
|
||||
tags, err = FFProbeTagExtractor(path)
|
||||
if err == nil {
|
||||
return tagsOrErr(tags)
|
||||
}
|
||||
|
||||
return nil, errors.New("Could not extract tags")
|
||||
}
|
|
@ -1,108 +0,0 @@
|
|||
package tag_extractor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os/exec"
|
||||
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
/*
|
||||
def load_tag_information_ffprobe(file: File) -> Tags:
|
||||
path = file.join_path_to()
|
||||
tags = Tags()
|
||||
|
||||
command_args = [
|
||||
ffprobe_path,
|
||||
"-v", "quiet",
|
||||
"-print_format", "json",
|
||||
"-show_format",
|
||||
path
|
||||
]
|
||||
|
||||
ffprobe_output = run_command(
|
||||
command_args, capture_output=True).stdout
|
||||
|
||||
data = load_json_string(ffprobe_output)
|
||||
file_tags = data["format"]["tags"]
|
||||
|
||||
title = None
|
||||
artist = None
|
||||
|
||||
try:
|
||||
print(file_tags.keys())
|
||||
if "title" in file_tags.keys():
|
||||
title = file_tags["title"]
|
||||
elif "TITLE" in file_tags.keys():
|
||||
title = file_tags["TITLE"]
|
||||
|
||||
if "artist" in file_tags.keys():
|
||||
artist = file_tags["artist"]
|
||||
elif "ARTIST" in file_tags.keys():
|
||||
artist = file_tags["ARTIST"]
|
||||
except Exception as e:
|
||||
print(data["format"]["tags"], file, e)
|
||||
exit()
|
||||
|
||||
if title is None or artist is None:
|
||||
raise Exception("Could Not Load Tags Using FFprobe")
|
||||
|
||||
tags.title = title
|
||||
tags.artist = artist
|
||||
return tags
|
||||
*/
|
||||
|
||||
type FFProbeTags map[string]string
|
||||
|
||||
type FFProbeFormat struct {
|
||||
Tags FFProbeTags `json:"tags"`
|
||||
}
|
||||
|
||||
type FFProbeOutput struct {
|
||||
Format FFProbeFormat `json:"format"`
|
||||
}
|
||||
|
||||
func FFProbeTagExtractor(path string) (*types.Tags, error) {
|
||||
ffprobe_output_str, err := exec.Command(
|
||||
"ffprobe",
|
||||
"-v", "quiet",
|
||||
"-print_format", "json",
|
||||
"-show_format",
|
||||
path,
|
||||
).Output()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var ffprobe_output FFProbeOutput
|
||||
err = json.Unmarshal([]byte(ffprobe_output_str), &ffprobe_output)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
file_tags := ffprobe_output.Format.Tags
|
||||
|
||||
tags := &types.Tags{
|
||||
Title: "",
|
||||
Artist: "",
|
||||
}
|
||||
|
||||
if tag, ok := file_tags["title"]; ok {
|
||||
tags.Title = tag
|
||||
}
|
||||
|
||||
if tag, ok := file_tags["TITLE"]; ok {
|
||||
tags.Title = tag
|
||||
}
|
||||
|
||||
if tag, ok := file_tags["artist"]; ok {
|
||||
tags.Artist = tag
|
||||
}
|
||||
|
||||
if tag, ok := file_tags["ARTIST"]; ok {
|
||||
tags.Artist = tag
|
||||
}
|
||||
|
||||
return tags, nil
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package tag_extractor
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/dhowden/tag"
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
func TaglibExtractor(path string) (*types.Tags, error) {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
meta, err := tag.ReadFrom(file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &types.Tags{
|
||||
Title: meta.Title(),
|
||||
Artist: meta.Artist(),
|
||||
}, nil
|
||||
}
|
|
@ -1,198 +0,0 @@
|
|||
package transcoder
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type Preset struct {
|
||||
Name string `json:"name"`
|
||||
Config *TranscodeConfig `json:"config"`
|
||||
}
|
||||
|
||||
var TranscodePresets map[string][]*Preset
|
||||
|
||||
func add_to_presets(category string, items []*Preset) {
|
||||
if _, ok := TranscodePresets[category]; !ok {
|
||||
TranscodePresets[category] = make([]*Preset, 0)
|
||||
}
|
||||
for _, preset := range items {
|
||||
TranscodePresets[category] = append(TranscodePresets[category], preset)
|
||||
}
|
||||
}
|
||||
|
||||
func add_mp3_presets() {
|
||||
mp3_presets := make([]*Preset, 0)
|
||||
|
||||
mp3_bitrates := []int{8, 16, 24, 32, 40, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320}
|
||||
|
||||
for _, bitrate := range mp3_bitrates {
|
||||
mp3_presets = append(mp3_presets, &Preset{
|
||||
Name: fmt.Sprintf("mp3-%dk", bitrate),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "libmp3lame",
|
||||
Container: "mp3",
|
||||
FileExtension: "mp3",
|
||||
UseBitrate: true,
|
||||
Bitrate: fmt.Sprintf("%dk", bitrate),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
mp3_qualities := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
|
||||
for _, quality := range mp3_qualities {
|
||||
mp3_presets = append(mp3_presets, &Preset{
|
||||
Name: fmt.Sprintf("mp3-v%d", quality),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "libmp3lame",
|
||||
Container: "mp3",
|
||||
FileExtension: "mp3",
|
||||
UseQuality: true,
|
||||
Quality: fmt.Sprintf("%d", quality),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
add_to_presets("mp3", mp3_presets)
|
||||
}
|
||||
|
||||
func add_opus_presets() {
|
||||
opus_presets := make([]*Preset, 0)
|
||||
|
||||
opus_bitrates := []int{16, 24, 32, 64, 96, 128, 256}
|
||||
|
||||
for _, bitrate := range opus_bitrates {
|
||||
opus_presets = append(opus_presets, &Preset{
|
||||
Name: fmt.Sprintf("opus-%dk", bitrate),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "libopus",
|
||||
Container: "ogg",
|
||||
FileExtension: "opus",
|
||||
UseBitrate: true,
|
||||
Bitrate: fmt.Sprintf("%dk", bitrate),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
add_to_presets("opus", opus_presets)
|
||||
}
|
||||
|
||||
func add_vorbis_presets() {
|
||||
vorbis_presets := make([]*Preset, 0)
|
||||
|
||||
vorbis_qualities := []int{-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
|
||||
for _, quality := range vorbis_qualities {
|
||||
vorbis_presets = append(vorbis_presets, &Preset{
|
||||
Name: fmt.Sprintf("vorbis-v%d", quality),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "libvorbis",
|
||||
Container: "ogg",
|
||||
FileExtension: "ogg",
|
||||
UseQuality: true,
|
||||
Quality: fmt.Sprintf("%d", quality),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
add_to_presets("vorbis", vorbis_presets)
|
||||
}
|
||||
|
||||
func add_g726_presets() {
|
||||
g726_presets := make([]*Preset, 0)
|
||||
|
||||
g726_bitrates := []int{16, 24, 32, 40}
|
||||
|
||||
for _, bitrate := range g726_bitrates {
|
||||
g726_presets = append(g726_presets, &Preset{
|
||||
Name: fmt.Sprintf("g726-%dk", bitrate),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "g726",
|
||||
Container: "matroska",
|
||||
FileExtension: "mka",
|
||||
SampleRate: "8000",
|
||||
Channels: "1",
|
||||
UseBitrate: true,
|
||||
Bitrate: fmt.Sprintf("%dk", bitrate),
|
||||
},
|
||||
})
|
||||
}
|
||||
add_to_presets("g726", g726_presets)
|
||||
}
|
||||
|
||||
func add_speex_presets() {
|
||||
speex_presets := make([]*Preset, 0)
|
||||
|
||||
speex_qualities := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
||||
|
||||
for _, quality := range speex_qualities {
|
||||
speex_presets = append(speex_presets, &Preset{
|
||||
Name: fmt.Sprintf("speex-q%d", quality),
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "libspeex",
|
||||
Container: "ogg",
|
||||
FileExtension: "ogg",
|
||||
UseQuality: true,
|
||||
Quality: fmt.Sprintf("%d", quality),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
add_to_presets("speex", speex_presets)
|
||||
}
|
||||
|
||||
func add_flac_preset() {
|
||||
add_to_presets("flac", []*Preset{
|
||||
{
|
||||
Name: "flac",
|
||||
Config: &TranscodeConfig{
|
||||
Encoder: "flac",
|
||||
Container: "flac",
|
||||
FileExtension: "flac",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func add_wav_preset() {
|
||||
add_to_presets("wav", []*Preset{
|
||||
{
|
||||
Name: "wav",
|
||||
Config: &TranscodeConfig{
|
||||
Container: "wav",
|
||||
FileExtension: "wav",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func GetPresetByName(name string) (*Preset, error) {
|
||||
for _, category := range TranscodePresets {
|
||||
for _, preset := range category {
|
||||
if preset.Name == name {
|
||||
return preset, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("No preset with name %s", name)
|
||||
}
|
||||
|
||||
func PrintTranscodePresets() {
|
||||
for cat_name, cat := range TranscodePresets {
|
||||
fmt.Printf("Category %s:\n", cat_name)
|
||||
for _, preset := range cat {
|
||||
fmt.Printf("- %s\n", preset.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
TranscodePresets = make(map[string][]*Preset, 0)
|
||||
|
||||
add_mp3_presets()
|
||||
add_opus_presets()
|
||||
add_vorbis_presets()
|
||||
add_g726_presets()
|
||||
add_speex_presets()
|
||||
add_flac_preset()
|
||||
add_wav_preset()
|
||||
}
|
|
@ -1,181 +0,0 @@
|
|||
package transcoder
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitlab.com/ChaotiCryptidz/musicutil/types"
|
||||
)
|
||||
|
||||
type TranscodeConfig struct {
|
||||
UseQuality bool `json:"use_quality"`
|
||||
UseBitrate bool `json:"use_bitrate"`
|
||||
Encoder string `json:"encoder"`
|
||||
FileExtension string `json:"file_extension"`
|
||||
Container string `json:"container"`
|
||||
Bitrate string `json:"bitrate"`
|
||||
Quality string `json:"quality"`
|
||||
SampleRate string `json:"sample_rate"`
|
||||
Channels string `json:"channels"`
|
||||
}
|
||||
|
||||
func isNotEmptyString(x string) bool {
|
||||
if len(strings.TrimSpace(x)) == 0 {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func progressDurationToMilliSeconds(duration string) int64 {
|
||||
fields := strings.Split(strings.TrimSpace(duration), ":")
|
||||
durationNs := int64(0)
|
||||
|
||||
h, _ := strconv.ParseInt(fields[0], 10, 64)
|
||||
durationNs += int64(time.Hour) * h
|
||||
|
||||
m, _ := strconv.ParseInt(fields[1], 10, 64)
|
||||
durationNs += int64(time.Minute) * m
|
||||
|
||||
s, _ := strconv.ParseFloat(fields[2], 64)
|
||||
durationNs += int64(float64(time.Second) * s)
|
||||
|
||||
return time.Duration(durationNs).Milliseconds()
|
||||
}
|
||||
|
||||
func getFileLengthMilliSeconds(filename string) (int64, error) {
|
||||
type FFProbeFormat struct {
|
||||
Duration string `json:"duration"`
|
||||
}
|
||||
type FFProbeOutput struct {
|
||||
Format FFProbeFormat `json:"format"`
|
||||
}
|
||||
|
||||
ffprobe_output_str, err := exec.Command(
|
||||
"ffprobe",
|
||||
"-v", "quiet",
|
||||
"-print_format", "json",
|
||||
"-show_format",
|
||||
filename,
|
||||
).Output()
|
||||
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var ffprobe_output FFProbeOutput
|
||||
err = json.Unmarshal([]byte(ffprobe_output_str), &ffprobe_output)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
} else {
|
||||
duration_str := ffprobe_output.Format.Duration
|
||||
duration_float, err := strconv.ParseFloat(duration_str, 64)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
duration_millis := int64(math.Round(duration_float * 1000))
|
||||
return duration_millis, nil
|
||||
}
|
||||
}
|
||||
|
||||
func Transcode(file *types.File, config *TranscodeConfig, progress_chan chan string, dest string) (string, error) {
|
||||
command_args := make([]string, 0)
|
||||
command_args = append(command_args, "-y")
|
||||
command_args = append(command_args, "-hide_banner")
|
||||
|
||||
command_args = append(command_args, "-i")
|
||||
command_args = append(command_args, file.JoinPathTo())
|
||||
|
||||
if isNotEmptyString(config.Encoder) {
|
||||
command_args = append(command_args, "-c:a")
|
||||
command_args = append(command_args, config.Encoder)
|
||||
}
|
||||
|
||||
if isNotEmptyString(config.Container) {
|
||||
command_args = append(command_args, "-f")
|
||||
command_args = append(command_args, config.Container)
|
||||
}
|
||||
|
||||
if isNotEmptyString(config.SampleRate) {
|
||||
command_args = append(command_args, "-ar")
|
||||
command_args = append(command_args, config.SampleRate)
|
||||
}
|
||||
|
||||
if isNotEmptyString(config.Channels) {
|
||||
command_args = append(command_args, "-ac")
|
||||
command_args = append(command_args, config.Channels)
|
||||
}
|
||||
|
||||
if config.UseQuality {
|
||||
command_args = append(command_args, "-q:a")
|
||||
command_args = append(command_args, config.Quality)
|
||||
}
|
||||
|
||||
if config.UseBitrate {
|
||||
command_args = append(command_args, "-b:a")
|
||||
command_args = append(command_args, config.Bitrate)
|
||||
}
|
||||
|
||||
command_args = append(command_args, dest)
|
||||
|
||||
// Progress Shenanigans
|
||||
|
||||
if progress_chan != nil {
|
||||
total_length_milliseconds, err := getFileLengthMilliSeconds(file.JoinPathTo())
|
||||
if err != nil {
|
||||
goto end
|
||||
}
|
||||
|
||||
progress_temp_dir, err := os.MkdirTemp("", "*-musicutil_transcode_temp")
|
||||
if err != nil {
|
||||
goto end
|
||||
}
|
||||
defer os.RemoveAll(progress_temp_dir)
|
||||
|
||||
progress_filename := progress_temp_dir + "/progress.log"
|
||||
progress_file, err := os.Create(progress_filename)
|
||||
if err != nil {
|
||||
goto end
|
||||
}
|
||||
defer os.Remove(progress_filename)
|
||||
|
||||
command_args = append(command_args, "-progress", progress_filename, "-nostats")
|
||||
|
||||
go func() {
|
||||
reader := bufio.NewReader(progress_file)
|
||||
for {
|
||||
line, err := reader.ReadBytes('\n')
|
||||
if err == nil {
|
||||
if strings.HasPrefix(string(line), "out_time=") {
|
||||
out_time := strings.TrimSuffix(strings.TrimPrefix(string(line), "out_time="), "\n")
|
||||
out_time_ms := progressDurationToMilliSeconds(out_time)
|
||||
|
||||
progress_chan <- fmt.Sprintf("%0.2f%%", (float64(out_time_ms) / float64(total_length_milliseconds) * 100))
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
end:
|
||||
cmd := exec.Command("ffmpeg", command_args...)
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
fmt.Println(output)
|
||||
return string(output), errors.New("ffmpeg error")
|
||||
}
|
||||
|
||||
if progress_chan != nil {
|
||||
close(progress_chan)
|
||||
}
|
||||
return string(output), nil
|
||||
}
|
Loading…
Reference in a new issue