Fix client dfget bug and support digest (#432)

Signed-off-by: zuozheng.hzz <zuozheng.hzz@alibaba-inc.com>
This commit is contained in:
加菲 2021-07-08 21:16:29 +08:00 committed by Gaius
parent 3f861bdf6e
commit eda5839eb8
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
42 changed files with 3042 additions and 2106 deletions

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2017 Zack
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,865 +0,0 @@
/*
* Copyright 2020 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// copy from https://github.com/schollz/progressbar, remove lock
// original license, see LICENSE
package progressbar
import (
"errors"
"fmt"
"io"
"math"
"os"
"regexp"
"strings"
"time"
"github.com/mattn/go-runewidth"
"github.com/mitchellh/colorstring"
"golang.org/x/term"
)
// ProgressBar is a simple progress bar
type ProgressBar struct {
state state
config config
}
// State is the basic properties of the bar
type State struct {
CurrentPercent float64
CurrentBytes float64
SecondsSince float64
SecondsLeft float64
KBsPerSecond float64
}
type state struct {
currentNum int64
currentPercent int
lastPercent int
currentSaucerSize int
lastShown time.Time
startTime time.Time
counterTime time.Time
counterNumSinceLast int64
counterLastTenRates []float64
maxLineWidth int
currentBytes float64
finished bool
}
type config struct {
max int64 // max number of the counter
maxHumanized string
maxHumanizedSuffix string
width int
writer io.Writer
theme Theme
renderWithBlankState bool
description string
iterationString string
ignoreLength bool // ignoreLength if max bytes not known
// whether the output is expected to contain color codes
colorCodes bool
// show rate of change in kB/sec or MB/sec
showBytes bool
// show the iterations per second
showIterationsPerSecond bool
showIterationsCount bool
// whether the progress bar should attempt to predict the finishing
// time of the progress based on the start time and the average
// number of seconds between increments.
predictTime bool
// minimum time to wait in between updates
throttleDuration time.Duration
// clear bar once finished
clearOnFinish bool
// spinnerType should be a number between 0-75
spinnerType int
// fullWidth specifies whether to measure and set the bar to a specific width
fullWidth bool
// invisible doesn't render the bar at all, useful for debugging
invisible bool
onCompletion func()
// whether the render function should make use of ANSI codes to reduce console I/O
useANSICodes bool
}
// Theme defines the elements of the bar
type Theme struct {
Saucer string
SaucerHead string
SaucerPadding string
BarStart string
BarEnd string
}
// Option is the type all options need to adhere to
type Option func(p *ProgressBar)
// OptionSetWidth sets the width of the bar
func OptionSetWidth(s int) Option {
return func(p *ProgressBar) {
p.config.width = s
}
}
// OptionSpinnerType sets the type of spinner used for indeterminate bars
func OptionSpinnerType(spinnerType int) Option {
return func(p *ProgressBar) {
p.config.spinnerType = spinnerType
}
}
// OptionSetTheme sets the elements the bar is constructed of
func OptionSetTheme(t Theme) Option {
return func(p *ProgressBar) {
p.config.theme = t
}
}
// OptionSetVisibility sets the visibility
func OptionSetVisibility(visibility bool) Option {
return func(p *ProgressBar) {
p.config.invisible = !visibility
}
}
// OptionFullWidth sets the bar to be full width
func OptionFullWidth() Option {
return func(p *ProgressBar) {
p.config.fullWidth = true
}
}
// OptionSetWriter sets the output writer (defaults to os.StdOut)
func OptionSetWriter(w io.Writer) Option {
return func(p *ProgressBar) {
p.config.writer = w
}
}
// OptionSetRenderBlankState sets whether or not to render a 0% bar on construction
func OptionSetRenderBlankState(r bool) Option {
return func(p *ProgressBar) {
p.config.renderWithBlankState = r
}
}
// OptionSetDescription sets the description of the bar to render in front of it
func OptionSetDescription(description string) Option {
return func(p *ProgressBar) {
p.config.description = description
}
}
// OptionEnableColorCodes enables or disables support for color codes
// using mitchellh/colorstring
func OptionEnableColorCodes(colorCodes bool) Option {
return func(p *ProgressBar) {
p.config.colorCodes = colorCodes
}
}
// OptionSetPredictTime will also attempt to predict the time remaining.
func OptionSetPredictTime(predictTime bool) Option {
return func(p *ProgressBar) {
p.config.predictTime = predictTime
}
}
// OptionShowCount will also print current count out of total
func OptionShowCount() Option {
return func(p *ProgressBar) {
p.config.showIterationsCount = true
}
}
// OptionShowIts will also print the iterations/second
func OptionShowIts() Option {
return func(p *ProgressBar) {
p.config.showIterationsPerSecond = true
}
}
// OptionSetItsString sets what's displayed for interations a second. The default is "it" which would display: "it/s"
func OptionSetItsString(iterationString string) Option {
return func(p *ProgressBar) {
p.config.iterationString = iterationString
}
}
// OptionThrottle will wait the specified duration before updating again. The default
// duration is 0 seconds.
func OptionThrottle(duration time.Duration) Option {
return func(p *ProgressBar) {
p.config.throttleDuration = duration
}
}
// OptionClearOnFinish will clear the bar once its finished
func OptionClearOnFinish() Option {
return func(p *ProgressBar) {
p.config.clearOnFinish = true
}
}
// OptionOnCompletion will invoke cmpl function once its finished
func OptionOnCompletion(cmpl func()) Option {
return func(p *ProgressBar) {
p.config.onCompletion = cmpl
}
}
// OptionShowBytes will update the progress bar
// configuration settings to display/hide kBytes/Sec
func OptionShowBytes(val bool) Option {
return func(p *ProgressBar) {
p.config.showBytes = val
}
}
// OptionUseANSICodes will use more optimized terminal i/o.
//
// Only useful in environments with support for ANSI escape sequences.
func OptionUseANSICodes(val bool) Option {
return func(p *ProgressBar) {
p.config.useANSICodes = val
}
}
var defaultTheme = Theme{Saucer: "█", SaucerPadding: " ", BarStart: "|", BarEnd: "|"}
// NewOptions constructs a new instance of ProgressBar, with any options you specify
func NewOptions(max int, options ...Option) *ProgressBar {
return NewOptions64(int64(max), options...)
}
// NewOptions64 constructs a new instance of ProgressBar, with any options you specify
func NewOptions64(max int64, options ...Option) *ProgressBar {
b := ProgressBar{
state: getBasicState(),
config: config{
writer: os.Stdout,
theme: defaultTheme,
iterationString: "it",
width: 40,
max: max,
throttleDuration: 0 * time.Nanosecond,
predictTime: true,
spinnerType: 9,
invisible: false,
},
}
for _, o := range options {
o(&b)
}
if b.config.spinnerType < 0 || b.config.spinnerType > 75 {
panic("invalid spinner type, must be between 0 and 75")
}
// ignoreLength if max bytes not known
if b.config.max == -1 {
b.config.ignoreLength = true
b.config.max = int64(b.config.width)
b.config.predictTime = false
}
b.config.maxHumanized, b.config.maxHumanizedSuffix = humanizeBytes(float64(b.config.max))
if b.config.renderWithBlankState {
b.RenderBlank()
}
return &b
}
func getBasicState() state {
now := time.Now()
return state{
startTime: now,
lastShown: now,
counterTime: now,
}
}
// New returns a new ProgressBar
// with the specified maximum
func New(max int) *ProgressBar {
return NewOptions(max)
}
// DefaultBytes provides a progressbar to measure byte
// throughput with recommended defaults.
// Set maxBytes to -1 to use as a spinner.
func DefaultBytes(maxBytes int64, description ...string) *ProgressBar {
desc := ""
if len(description) > 0 {
desc = description[0]
}
bar := NewOptions64(
maxBytes,
OptionSetDescription(desc),
OptionSetWriter(os.Stderr),
OptionShowBytes(true),
OptionSetWidth(10),
OptionThrottle(65*time.Millisecond),
OptionShowCount(),
OptionOnCompletion(func() {
fmt.Fprint(os.Stderr, "\n")
}),
OptionSpinnerType(14),
OptionFullWidth(),
)
bar.RenderBlank()
return bar
}
// Default provides a progressbar with recommended defaults.
// Set max to -1 to use as a spinner.
func Default(max int64, description ...string) *ProgressBar {
desc := ""
if len(description) > 0 {
desc = description[0]
}
bar := NewOptions64(
max,
OptionSetDescription(desc),
OptionSetWriter(os.Stderr),
OptionSetWidth(10),
OptionThrottle(65*time.Millisecond),
OptionShowCount(),
OptionShowIts(),
OptionOnCompletion(func() {
fmt.Fprint(os.Stderr, "\n")
}),
OptionSpinnerType(14),
OptionFullWidth(),
)
bar.RenderBlank()
return bar
}
// RenderBlank renders the current bar state, you can use this to render a 0% state
func (p *ProgressBar) RenderBlank() error {
if p.config.invisible {
return nil
}
return p.render()
}
// Reset will reset the clock that is used
// to calculate current time and the time left.
func (p *ProgressBar) Reset() {
p.state = getBasicState()
}
// Finish will fill the bar to full
func (p *ProgressBar) Finish() error {
p.state.currentNum = p.config.max
return p.Add(0)
}
// Add will add the specified amount to the progressbar
func (p *ProgressBar) Add(num int) error {
return p.Add64(int64(num))
}
// Set wil set the bar to a current number
func (p *ProgressBar) Set(num int) error {
return p.Set64(int64(num))
}
// Set64 wil set the bar to a current number
func (p *ProgressBar) Set64(num int64) error {
toAdd := num - int64(p.state.currentBytes)
return p.Add64(toAdd)
}
// Add64 will add the specified amount to the progressbar
func (p *ProgressBar) Add64(num int64) error {
if p.config.invisible {
return nil
}
if p.config.max == 0 {
return errors.New("max must be greater than 0")
}
if p.state.currentNum < p.config.max {
if p.config.ignoreLength {
p.state.currentNum = (p.state.currentNum + num) % p.config.max
} else {
p.state.currentNum += num
}
}
p.state.currentBytes += float64(num)
// reset the countdown timer every second to take rolling average
p.state.counterNumSinceLast += num
if time.Since(p.state.counterTime).Seconds() > 0.5 {
p.state.counterLastTenRates = append(p.state.counterLastTenRates, float64(p.state.counterNumSinceLast)/time.Since(p.state.counterTime).Seconds())
if len(p.state.counterLastTenRates) > 10 {
p.state.counterLastTenRates = p.state.counterLastTenRates[1:]
}
p.state.counterTime = time.Now()
p.state.counterNumSinceLast = 0
}
percent := float64(p.state.currentNum) / float64(p.config.max)
p.state.currentSaucerSize = int(percent * float64(p.config.width))
p.state.currentPercent = int(percent * 100)
updateBar := p.state.currentPercent != p.state.lastPercent && p.state.currentPercent > 0
p.state.lastPercent = p.state.currentPercent
if p.state.currentNum > p.config.max {
return errors.New("current number exceeds max")
}
// always update if show bytes/second or its/second
if updateBar || p.config.showIterationsPerSecond || p.config.showIterationsCount {
return p.render()
}
return nil
}
// Clear erases the progress bar from the current line
func (p *ProgressBar) Clear() error {
return clearProgressBar(p.config, p.state)
}
// Describe will change the description shown before the progress, which
// can be changed on the fly (as for a slow running process).
func (p *ProgressBar) Describe(description string) {
p.config.description = description
}
// New64 returns a new ProgressBar
// with the specified maximum
func New64(max int64) *ProgressBar {
return NewOptions64(max)
}
// GetMax returns the max of a bar
func (p *ProgressBar) GetMax() int {
return int(p.config.max)
}
// GetMax64 returns the current max
func (p *ProgressBar) GetMax64() int64 {
return p.config.max
}
// ChangeMax takes in a int
// and changes the max value
// of the progress bar
func (p *ProgressBar) ChangeMax(newMax int) {
p.ChangeMax64(int64(newMax))
}
// ChangeMax64 is basically
// the same as ChangeMax,
// but takes in a int64
// to avoid casting
func (p *ProgressBar) ChangeMax64(newMax int64) {
p.config.max = newMax
p.Add(0) // re-render
}
// IsFinished returns true if progreess bar is completed
func (p *ProgressBar) IsFinished() bool {
return p.state.finished
}
// render renders the progress bar, updating the maximum
// rendered line width. this function is not thread-safe,
// so it must be called with an acquired lock.
func (p *ProgressBar) render() error {
// make sure that the rendering is not happening too quickly
// but always show if the currentNum reaches the max
if time.Since(p.state.lastShown).Nanoseconds() < p.config.throttleDuration.Nanoseconds() &&
p.state.currentNum < p.config.max {
return nil
}
if !p.config.useANSICodes {
// first, clear the existing progress bar
err := clearProgressBar(p.config, p.state)
if err != nil {
return err
}
}
// check if the progress bar is finished
if !p.state.finished && p.state.currentNum >= p.config.max {
p.state.finished = true
if !p.config.clearOnFinish {
renderProgressBar(p.config, p.state)
}
if p.config.onCompletion != nil {
p.config.onCompletion()
}
}
if p.state.finished {
// when using ANSI codes we don't pre-clean the current line
if p.config.useANSICodes {
err := clearProgressBar(p.config, p.state)
if err != nil {
return err
}
}
return nil
}
// then, re-render the current progress bar
w, err := renderProgressBar(p.config, p.state)
if err != nil {
return err
}
if w > p.state.maxLineWidth {
p.state.maxLineWidth = w
}
p.state.lastShown = time.Now()
return nil
}
// State returns the current state
func (p *ProgressBar) State() State {
s := State{}
s.CurrentPercent = float64(p.state.currentNum) / float64(p.config.max)
s.CurrentBytes = p.state.currentBytes
s.SecondsSince = time.Since(p.state.startTime).Seconds()
if p.state.currentNum > 0 {
s.SecondsLeft = s.SecondsSince / float64(p.state.currentNum) * (float64(p.config.max) - float64(p.state.currentNum))
}
s.KBsPerSecond = float64(p.state.currentBytes) / 1024.0 / s.SecondsSince
return s
}
// regex matching ansi escape codes
var ansiRegex = regexp.MustCompile(`\x1b\[[0-9;]*[a-zA-Z]`)
func getStringWidth(c config, str string, colorize bool) int {
if c.colorCodes {
// convert any color codes in the progress bar into the respective ANSI codes
str = colorstring.Color(str)
}
// the width of the string, if printed to the console
// does not include the carriage return character
cleanString := strings.Replace(str, "\r", "", -1)
if c.colorCodes {
// the ANSI codes for the colors do not take up space in the console output,
// so they do not count towards the output string width
cleanString = ansiRegex.ReplaceAllString(cleanString, "")
}
// get the amount of runes in the string instead of the
// character count of the string, as some runes span multiple characters.
// see https://stackoverflow.com/a/12668840/2733724
stringWidth := runewidth.StringWidth(cleanString)
return stringWidth
}
func renderProgressBar(c config, s state) (int, error) {
leftBrac := ""
rightBrac := ""
saucer := ""
bytesString := ""
str := ""
averageRate := average(s.counterLastTenRates)
if len(s.counterLastTenRates) == 0 || s.finished {
// if no average samples, or if finished,
// then average rate should be the total rate
averageRate = s.currentBytes / time.Since(s.startTime).Seconds()
}
// show iteration count in "current/total" iterations format
if c.showIterationsCount {
if bytesString == "" {
bytesString += "("
} else {
bytesString += ", "
}
if !c.ignoreLength {
if c.showBytes {
currentHumanize, currentSuffix := humanizeBytes(s.currentBytes)
if currentSuffix == c.maxHumanizedSuffix {
bytesString += fmt.Sprintf("%s/%s%s", currentHumanize, c.maxHumanized, c.maxHumanizedSuffix)
} else {
bytesString += fmt.Sprintf("%s%s/%s%s", currentHumanize, currentSuffix, c.maxHumanized, c.maxHumanizedSuffix)
}
} else {
bytesString += fmt.Sprintf("%.0f/%d", s.currentBytes, c.max)
}
} else {
if c.showBytes {
currentHumanize, currentSuffix := humanizeBytes(s.currentBytes)
bytesString += fmt.Sprintf("%s%s", currentHumanize, currentSuffix)
} else {
bytesString += fmt.Sprintf("%.0f/%s", s.currentBytes, "-")
}
}
}
// show rolling average rate in kB/sec or MB/sec
if c.showBytes {
if bytesString == "" {
bytesString += "("
} else {
bytesString += ", "
}
kbPerSecond := averageRate / 1024.0
if kbPerSecond > 1024.0 {
bytesString += fmt.Sprintf("%0.3f MB/s", kbPerSecond/1024.0)
} else if kbPerSecond > 0 {
bytesString += fmt.Sprintf("%0.3f kB/s", kbPerSecond)
}
}
// show iterations rate
if c.showIterationsPerSecond {
if bytesString == "" {
bytesString += "("
} else {
bytesString += ", "
}
if averageRate > 1 {
bytesString += fmt.Sprintf("%0.0f %s/s", averageRate, c.iterationString)
} else {
bytesString += fmt.Sprintf("%0.0f %s/min", 60*averageRate, c.iterationString)
}
}
if bytesString != "" {
bytesString += ")"
}
// show time prediction in "current/total" seconds format
if c.predictTime {
leftBrac = (time.Duration(time.Since(s.startTime).Seconds()) * time.Second).String()
rightBrac = (time.Duration((1/averageRate)*(float64(c.max)-float64(s.currentNum))) * time.Second).String()
}
if c.fullWidth && !c.ignoreLength {
width, _, err := term.GetSize(int(os.Stdout.Fd()))
if err != nil {
width, _, err = term.GetSize(int(os.Stderr.Fd()))
if err != nil {
width = 80
}
}
c.width = width - getStringWidth(c, c.description, true) - 14 - len(bytesString) - len(leftBrac) - len(rightBrac)
s.currentSaucerSize = int(float64(s.currentPercent) / 100.0 * float64(c.width))
}
if s.currentSaucerSize > 0 {
if c.ignoreLength {
saucer = strings.Repeat(c.theme.SaucerPadding, s.currentSaucerSize-1)
} else {
saucer = strings.Repeat(c.theme.Saucer, s.currentSaucerSize-1)
}
saucerHead := c.theme.SaucerHead
if saucerHead == "" || s.currentSaucerSize == c.width {
// use the saucer for the saucer head if it hasn't been set
// to preserve backwards compatibility
saucerHead = c.theme.Saucer
}
saucer += saucerHead
}
/*
Progress Bar format
Description % |------ | (kb/s) (iteration count) (iteration rate) (predict time)
*/
repeatAmount := c.width - s.currentSaucerSize
if repeatAmount < 0 {
repeatAmount = 0
}
if c.ignoreLength {
str = fmt.Sprintf("\r%s %s %s ",
spinners[c.spinnerType][int(math.Round(math.Mod(float64(time.Since(s.counterTime).Milliseconds()/100), float64(len(spinners[c.spinnerType])))))],
c.description,
bytesString,
)
} else if leftBrac == "" {
str = fmt.Sprintf("\r%s%4d%% %s%s%s%s %s ",
c.description,
s.currentPercent,
c.theme.BarStart,
saucer,
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
c.theme.BarEnd,
bytesString,
)
} else {
if s.currentPercent == 100 {
str = fmt.Sprintf("\r%s%4d%% %s%s%s%s %s",
c.description,
s.currentPercent,
c.theme.BarStart,
saucer,
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
c.theme.BarEnd,
bytesString,
)
} else {
str = fmt.Sprintf("\r%s%4d%% %s%s%s%s %s [%s:%s]",
c.description,
s.currentPercent,
c.theme.BarStart,
saucer,
strings.Repeat(c.theme.SaucerPadding, repeatAmount),
c.theme.BarEnd,
bytesString,
leftBrac,
rightBrac,
)
}
}
if c.colorCodes {
// convert any color codes in the progress bar into the respective ANSI codes
str = colorstring.Color(str)
}
return getStringWidth(c, str, false), writeString(c, str)
}
func clearProgressBar(c config, s state) error {
if c.useANSICodes {
// write the "clear current line" ANSI escape sequence
return writeString(c, "\033[2K\r")
}
// fill the current line with enough spaces
// to overwrite the progress bar and jump
// back to the beginning of the line
str := fmt.Sprintf("\r%s\r", strings.Repeat(" ", s.maxLineWidth))
return writeString(c, str)
}
func writeString(c config, str string) error {
if _, err := io.WriteString(c.writer, str); err != nil {
return err
}
if f, ok := c.writer.(*os.File); ok {
// ignore any errors in Sync(), as stdout
// can't be synced on some operating systems
// like Debian 9 (Stretch)
f.Sync()
}
return nil
}
// Reader is the progressbar io.Reader struct
type Reader struct {
io.Reader
bar *ProgressBar
}
// NewReader return a new Reader with a given progress bar.
func NewReader(r io.Reader, bar *ProgressBar) Reader {
return Reader{
Reader: r,
bar: bar,
}
}
// Read will read the data and add the number of bytes to the progressbar
func (r *Reader) Read(p []byte) (n int, err error) {
n, err = r.Reader.Read(p)
r.bar.Add(n)
return
}
// Close the reader when it implements io.Closer
func (r *Reader) Close() (err error) {
if closer, ok := r.Reader.(io.Closer); ok {
return closer.Close()
}
r.bar.Finish()
return
}
// Write implement io.Writer
func (p *ProgressBar) Write(b []byte) (n int, err error) {
n = len(b)
p.Add(n)
return
}
// Read implement io.Reader
func (p *ProgressBar) Read(b []byte) (n int, err error) {
n = len(b)
p.Add(n)
return
}
func average(xs []float64) float64 {
total := 0.0
for _, v := range xs {
total += v
}
return total / float64(len(xs))
}
func humanizeBytes(s float64) (string, string) {
sizes := []string{" B", " kB", " MB", " GB", " TB", " PB", " EB"}
base := 1024.0
if s < 10 {
return fmt.Sprintf("%2.0f", s), "B"
}
e := math.Floor(logn(float64(s), base))
suffix := sizes[int(e)]
val := math.Floor(float64(s)/math.Pow(base, e)*10+0.5) / 10
f := "%.0f"
if val < 10 {
f = "%.1f"
}
return fmt.Sprintf(f, val), suffix
}
func logn(n, b float64) float64 {
return math.Log(n) / math.Log(b)
}

View File

@ -1,99 +0,0 @@
/*
* Copyright 2020 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// copy from https://github.com/schollz/progressbar, remove lock
// original license, see LICENSE
package progressbar
var spinners = map[int][]string{
0: {"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"},
1: {"▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃", "▁"},
2: {"▖", "▘", "▝", "▗"},
3: {"┤", "┘", "┴", "└", "├", "┌", "┬", "┐"},
4: {"◢", "◣", "◤", "◥"},
5: {"◰", "◳", "◲", "◱"},
6: {"◴", "◷", "◶", "◵"},
7: {"◐", "◓", "◑", "◒"},
8: {".", "o", "O", "@", "*"},
9: {"|", "/", "-", "\\"},
10: {"◡◡", "⊙⊙", "◠◠"},
11: {"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"},
12: {">))'>", " >))'>", " >))'>", " >))'>", " >))'>", " <'((<", " <'((<", " <'((<"},
13: {"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"},
14: {"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"},
15: {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"},
16: {"▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"},
17: {"■", "□", "▪", "▫"},
18: {"←", "↑", "→", "↓"},
19: {"╫", "╪"},
20: {"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"},
21: {"⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"},
22: {"⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"},
23: {"⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"},
24: {"⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"},
25: {"ヲ", "ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ッ", "ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ン"},
26: {".", "..", "..."},
27: {"▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊", "▋", "▌", "▍", "▎", "▏", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█", "▇", "▆", "▅", "▄", "▃", "▂", "▁"},
28: {".", "o", "O", "°", "O", "o", "."},
29: {"+", "x"},
30: {"v", "<", "^", ">"},
31: {">>--->", " >>--->", " >>--->", " >>--->", " >>--->", " <---<<", " <---<<", " <---<<", " <---<<", "<---<<"},
32: {"|", "||", "|||", "||||", "|||||", "|||||||", "||||||||", "|||||||", "||||||", "|||||", "||||", "|||", "||", "|"},
33: {"[ ]", "[= ]", "[== ]", "[=== ]", "[==== ]", "[===== ]", "[====== ]", "[======= ]", "[======== ]", "[========= ]", "[==========]"},
34: {"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"},
35: {"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"},
36: {"[ ]", "[=> ]", "[===> ]", "[=====> ]", "[======> ]", "[========> ]", "[==========> ]", "[============> ]", "[==============> ]", "[================> ]", "[==================> ]", "[===================>]"},
37: {"", ""},
38: {"▌", "▀", "▐▄"},
39: {"🌍", "🌎", "🌏"},
40: {"◜", "◝", "◞", "◟"},
41: {"⬒", "⬔", "⬓", "⬕"},
42: {"⬖", "⬘", "⬗", "⬙"},
43: {"[>>> >]", "[]>>>> []", "[] >>>> []", "[] >>>> []", "[] >>>> []", "[] >>>>[]", "[>> >>]"},
44: {"♠", "♣", "♥", "♦"},
45: {"➞", "➟", "➠", "➡", "➠", "➟"},
46: {" | ", ` \ `, "_ ", ` \ `, " | ", " / ", " _", " / "},
47: {" . . . .", ". . . .", ". . . .", ". . . .", ". . . . ", ". . . . ."},
48: {" | ", " / ", " _ ", ` \ `, " | ", ` \ `, " _ ", " / "},
49: {"⎺", "⎻", "⎼", "⎽", "⎼", "⎻"},
50: {"▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"},
51: {"[ ]", "[ =]", "[ ==]", "[ ===]", "[====]", "[=== ]", "[== ]", "[= ]"},
52: {"( ● )", "( ● )", "( ● )", "( ● )", "( ●)", "( ● )", "( ● )", "( ● )", "( ● )"},
53: {"✶", "✸", "✹", "✺", "✹", "✷"},
54: {"▐|\\____________▌", "▐_|\\___________▌", "▐__|\\__________▌", "▐___|\\_________▌", "▐____|\\________▌", "▐_____|\\_______▌", "▐______|\\______▌", "▐_______|\\_____▌", "▐________|\\____▌", "▐_________|\\___▌", "▐__________|\\__▌", "▐___________|\\_▌", "▐____________|\\▌", "▐____________/|▌", "▐___________/|_▌", "▐__________/|__▌", "▐_________/|___▌", "▐________/|____▌", "▐_______/|_____▌", "▐______/|______▌", "▐_____/|_______▌", "▐____/|________▌", "▐___/|_________▌", "▐__/|__________▌", "▐_/|___________▌", "▐/|____________▌"},
55: {"▐⠂ ▌", "▐⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂▌", "▐ ⠠▌", "▐ ⡀▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐⠠ ▌"},
56: {"¿", "?"},
57: {"⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"},
58: {"⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"},
59: {". ", ".. ", "...", " ..", " .", " "},
60: {".", "o", "O", "°", "O", "o", "."},
61: {"▓", "▒", "░"},
62: {"▌", "▀", "▐", "▄"},
63: {"⊶", "⊷"},
64: {"▪", "▫"},
65: {"□", "■"},
66: {"▮", "▯"},
67: {"-", "=", "≡"},
68: {"d", "q", "p", "b"},
69: {"∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"},
70: {"🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "},
71: {"☗", "☖"},
72: {"⧇", "⧆"},
73: {"◉", "◎"},
74: {"㊂", "㊀", "㊁"},
75: {"⦾", "⦿"},
}

View File

@ -65,8 +65,8 @@ type ClientOption struct {
// DigestValue indicates digest value // DigestValue indicates digest value
DigestValue string `yaml:"digestValue,omitempty" mapstructure:"digestValue,omitempty"` DigestValue string `yaml:"digestValue,omitempty" mapstructure:"digestValue,omitempty"`
// Identifier identify download task, it is available merely when md5 param not exist. // Tag identify download task, it is available merely when md5 param not exist.
Identifier string `yaml:"identifier,omitempty" mapstructure:"identifier,omitempty"` Tag string `yaml:"tag,omitempty" mapstructure:"tag,omitempty"`
// CallSystem system name that executes dfget. // CallSystem system name that executes dfget.
CallSystem string `yaml:"callSystem,omitempty" mapstructure:"callSystem,omitempty"` CallSystem string `yaml:"callSystem,omitempty" mapstructure:"callSystem,omitempty"`
@ -81,7 +81,7 @@ type ClientOption struct {
// Filter filter some query params of url, use char '&' to separate different params. // Filter filter some query params of url, use char '&' to separate different params.
// eg: -f 'key&sign' will filter 'key' and 'sign' query param. // eg: -f 'key&sign' will filter 'key' and 'sign' query param.
// in this way, different urls correspond one same download task that can use p2p mode. // in this way, different urls correspond one same download task that can use p2p mode.
Filter []string `yaml:"filter,omitempty" mapstructure:"filter,omitempty"` Filter string `yaml:"filter,omitempty" mapstructure:"filter,omitempty"`
// Header of http request. // Header of http request.
// eg: --header='Accept: *' --header='Host: abc'. // eg: --header='Accept: *' --header='Host: abc'.
@ -93,8 +93,8 @@ type ClientOption struct {
// Insecure indicates whether skip secure verify when supernode interact with the source. // Insecure indicates whether skip secure verify when supernode interact with the source.
Insecure bool `yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"` Insecure bool `yaml:"insecure,omitempty" mapstructure:"insecure,omitempty"`
// ShowBar shows progress bar, it's conflict with `--console`. // ShowProgress shows progress bar, it's conflict with `--console`.
ShowBar bool `yaml:"showBar,omitempty" mapstructure:"showBar,omitempty"` ShowProgress bool `yaml:"show-progress,omitempty" mapstructure:"show-progress,omitempty"`
RateLimit rate.Limit `yaml:"rateLimit,omitempty" mapstructure:"rateLimit,omitempty"` RateLimit rate.Limit `yaml:"rateLimit,omitempty" mapstructure:"rateLimit,omitempty"`
@ -130,16 +130,22 @@ func (cfg *ClientOption) Validate() error {
} }
func (cfg *ClientOption) Convert(args []string) error { func (cfg *ClientOption) Convert(args []string) error {
var err error
if cfg.Output, err = filepath.Abs(cfg.Output); err != nil {
return err
}
if cfg.URL == "" && len(args) > 0 { if cfg.URL == "" && len(args) > 0 {
cfg.URL = args[0] cfg.URL = args[0]
} }
if cfg.Digest != "" { if cfg.Digest != "" {
cfg.Identifier = "" cfg.Tag = ""
} }
if cfg.Console { if cfg.Console {
cfg.ShowBar = false cfg.ShowProgress = false
} }
return nil return nil

View File

@ -29,13 +29,13 @@ var dfgetConfig = ClientOption{
Md5: "", Md5: "",
DigestMethod: "", DigestMethod: "",
DigestValue: "", DigestValue: "",
Identifier: "", Tag: "",
CallSystem: "", CallSystem: "",
Pattern: "", Pattern: "",
Cacerts: nil, Cacerts: nil,
Filter: nil, Filter: "",
Header: nil, Header: nil,
DisableBackSource: false, DisableBackSource: false,
Insecure: false, Insecure: false,
ShowBar: false, ShowProgress: false,
} }

View File

@ -25,13 +25,13 @@ var dfgetConfig = ClientOption{
Md5: "", Md5: "",
DigestMethod: "", DigestMethod: "",
DigestValue: "", DigestValue: "",
Identifier: "", Tag: "",
CallSystem: "", CallSystem: "",
Pattern: "", Pattern: "",
Cacerts: nil, Cacerts: nil,
Filter: nil, Filter: "",
Header: nil, Header: nil,
DisableBackSource: false, DisableBackSource: false,
Insecure: false, Insecure: false,
ShowBar: false, ShowProgress: false,
} }

View File

@ -95,7 +95,7 @@ func (um *uploadManager) handleUpload(w http.ResponseWriter, r *http.Request) {
log.Debugf("upload piece for task %s/%s to %s, request header: %#v", task, peer, r.RemoteAddr, r.Header) log.Debugf("upload piece for task %s/%s to %s, request header: %#v", task, peer, r.RemoteAddr, r.Header)
rg, err := clientutil.ParseRange(r.Header.Get(headers.Range), math.MaxInt64) rg, err := clientutil.ParseRange(r.Header.Get(headers.Range), math.MaxInt64)
if err != nil { if err != nil {
log.Error("parse range with error: %s", err) log.Errorf("parse range with error: %s", err)
http.Error(w, err.Error(), http.StatusBadRequest) http.Error(w, err.Error(), http.StatusBadRequest)
return return
} }

View File

@ -20,160 +20,217 @@ import (
"context" "context"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
"d7y.io/dragonfly/v2/client/clientutil/progressbar"
"d7y.io/dragonfly/v2/client/config" "d7y.io/dragonfly/v2/client/config"
"d7y.io/dragonfly/v2/internal/dferrors" "d7y.io/dragonfly/v2/internal/dfheaders"
logger "d7y.io/dragonfly/v2/internal/dflog" logger "d7y.io/dragonfly/v2/internal/dflog"
"d7y.io/dragonfly/v2/pkg/basic" "d7y.io/dragonfly/v2/pkg/basic"
"d7y.io/dragonfly/v2/pkg/rpc/base" "d7y.io/dragonfly/v2/pkg/rpc/base"
dfdaemongrpc "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon" "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon"
daemonclient "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client"
"d7y.io/dragonfly/v2/pkg/source" "d7y.io/dragonfly/v2/pkg/source"
"d7y.io/dragonfly/v2/pkg/util/digestutils"
// Init daemon rpc client "d7y.io/dragonfly/v2/pkg/util/stringutils"
_ "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client" "github.com/pkg/errors"
dfclient "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client" "github.com/schollz/progressbar/v3"
"github.com/go-http-utils/headers"
) )
var filter string func Download(cfg *config.DfgetConfig, client daemonclient.DaemonClient) error {
func Download(cfg *config.DfgetConfig, client dfclient.DaemonClient) error {
var ( var (
ctx = context.Background() ctx = context.Background()
cancel context.CancelFunc cancel context.CancelFunc
hdr = parseHeader(cfg.Header) wLog = logger.With("url", cfg.URL)
downError error
) )
if client == nil { wLog.Info("init success and start to download")
return downloadFromSource(cfg, hdr) fmt.Println("init success and start to download")
}
output, err := filepath.Abs(cfg.Output)
if err != nil {
return err
}
if cfg.Timeout > 0 { if cfg.Timeout > 0 {
ctx, cancel = context.WithTimeout(ctx, cfg.Timeout) ctx, cancel = context.WithTimeout(ctx, cfg.Timeout)
} else { } else {
ctx, cancel = context.WithCancel(ctx) ctx, cancel = context.WithCancel(ctx)
} }
defer cancel()
request := &dfdaemongrpc.DownRequest{ go func() {
Url: cfg.URL, defer cancel()
UrlMeta: &base.UrlMeta{ downError = download(ctx, client, cfg, wLog)
Digest: cfg.Digest, }()
Range: hdr[headers.Range],
Header: hdr, <-ctx.Done()
Filter: filter,
}, if ctx.Err() == context.DeadlineExceeded {
Output: output, return errors.Errorf("download timeout(%s)", cfg.Timeout)
Callsystem: cfg.CallSystem,
Uid: int64(basic.UserID),
Gid: int64(basic.UserGroup),
} }
var ( return downError
start = time.Now()
end time.Time
)
down, err := client.Download(ctx, request)
if err != nil {
return err
}
var (
result *dfdaemongrpc.DownResult
)
// todo using progressbar when showBar is true
pb := progressbar.DefaultBytes(-1, "Downloading")
for {
result, err = down.Recv()
if err != nil {
if de, ok := err.(*dferrors.DfError); ok {
logger.Errorf("dragonfly daemon returns error code %d/%s", de.Code, de.Message)
} else {
logger.Errorf("dragonfly daemon returns error %s", err)
}
break
}
if result.CompletedLength > 0 {
pb.Set64(int64(result.CompletedLength))
}
if result.Done {
pb.Describe("Downloaded")
pb.Finish()
end = time.Now()
fmt.Printf("Task: %s\nPeer: %s\n", result.TaskId, result.PeerId)
fmt.Printf("Download success, time cost: %dms, length: %d\n", end.Sub(start).Milliseconds(), result.CompletedLength)
break
}
}
if err != nil {
logger.Errorf("download by dragonfly error: %s", err)
return downloadFromSource(cfg, hdr)
}
return nil
} }
func downloadFromSource(cfg *config.DfgetConfig, hdr map[string]string) (err error) { func download(ctx context.Context, client daemonclient.DaemonClient, cfg *config.DfgetConfig, wLog *logger.SugaredLoggerOnWith) error {
if cfg.DisableBackSource { hdr := parseHeader(cfg.Header)
err = fmt.Errorf("dfget download error, and back source disabled")
logger.Warnf("%s", err) if client == nil {
return err return downloadFromSource(ctx, cfg, hdr)
} }
fmt.Println("dfget download error, try to download from source")
var ( var (
start = time.Now()
stream *daemonclient.DownResultStream
result *dfdaemon.DownResult
pb *progressbar.ProgressBar
request = newDownRequest(cfg, hdr)
downError error
)
if stream, downError = client.Download(ctx, request); downError == nil {
if cfg.ShowProgress {
pb = newProgressBar(-1)
}
for {
if result, downError = stream.Recv(); downError != nil {
break
}
if result.CompletedLength > 0 && pb != nil {
_ = pb.Set64(int64(result.CompletedLength))
}
// success
if result.Done {
if pb != nil {
pb.Describe("Downloaded")
_ = pb.Close()
}
wLog.Infof("download from daemon success, length:%dByte cost:%dms", result.CompletedLength, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %d Byte\n", result.CompletedLength)
break
}
}
}
if downError != nil {
wLog.Warnf("daemon downloads file error:%v", downError)
fmt.Printf("daemon downloads file error:%v\n", downError)
downError = downloadFromSource(ctx, cfg, hdr)
}
return downError
}
func downloadFromSource(ctx context.Context, cfg *config.DfgetConfig, hdr map[string]string) error {
if cfg.DisableBackSource {
return errors.New("try to download from source but back source is disabled")
}
var (
wLog = logger.With("url", cfg.URL)
start = time.Now() start = time.Now()
end time.Time
target *os.File target *os.File
response io.ReadCloser response io.ReadCloser
err error
written int64 written int64
) )
response, err = source.Download(context.Background(), cfg.URL, hdr) wLog.Info("try to download from source and ignore rate limit")
if err != nil { fmt.Println("try to download from source and ignore rate limit")
logger.Errorf("download from source error: %s", err)
if target, err = ioutil.TempFile(filepath.Dir(cfg.Output), ".df_"); err != nil {
return err
}
defer os.Remove(target.Name())
defer target.Close()
if response, err = source.Download(ctx, cfg.URL, hdr); err != nil {
return err return err
} }
defer response.Close() defer response.Close()
target, err = os.OpenFile(cfg.Output, os.O_RDWR|os.O_CREATE, 0644) if written, err = io.Copy(target, response); err != nil {
if err != nil {
logger.Errorf("open %s error: %s", cfg.Output, err)
return err return err
} }
written, err = io.Copy(target, response) if !stringutils.IsBlank(cfg.Digest) {
if err != nil { parsedHash := digestutils.Parse(cfg.Digest)
logger.Errorf("copied %d bytes to %s, with error: %s", written, cfg.Output, err) realHash := digestutils.HashFile(target.Name(), parsedHash[0])
return err
}
logger.Infof("copied %d bytes to %s", written, cfg.Output)
end = time.Now()
fmt.Printf("Download from source success, time cost: %dms\n", end.Sub(start).Milliseconds())
// change permission if realHash != parsedHash[1] {
logger.Infof("change own to uid %d gid %d", basic.UserID, basic.UserGroup) return errors.Errorf("%s digest is not matched: real[%s] expected[%s]", parsedHash[0], realHash, parsedHash[1])
if err = os.Chown(cfg.Output, basic.UserID, basic.UserGroup); err != nil { }
logger.Errorf("change own failed: %s", err) }
// change file owner
if err = os.Chown(target.Name(), basic.UserID, basic.UserGroup); err != nil {
return errors.Wrapf(err, "change file owner to uid[%d] gid[%d]", basic.UserID, basic.UserGroup)
}
if err = os.Rename(target.Name(), cfg.Output); err != nil {
return err return err
} }
wLog.Infof("download from source success, length:%dByte cost:%dms", written, time.Now().Sub(start).Milliseconds())
fmt.Printf("finish total length %d Byte\n", written)
return nil return nil
} }
func parseHeader(s []string) map[string]string { func parseHeader(s []string) map[string]string {
hdr := map[string]string{} hdr := make(map[string]string)
var key, value string
for _, h := range s { for _, h := range s {
idx := strings.Index(h, ":") idx := strings.Index(h, ":")
if idx > 0 { if idx > 0 {
hdr[h[:idx]] = strings.TrimLeft(h[idx:], " ") key = strings.TrimSpace(h[:idx])
value = strings.TrimSpace(h[idx+1:])
hdr[key] = value
} }
} }
return hdr return hdr
} }
func newDownRequest(cfg *config.DfgetConfig, hdr map[string]string) *dfdaemon.DownRequest {
return &dfdaemon.DownRequest{
Url: cfg.URL,
Output: cfg.Output,
Timeout: int64(cfg.Timeout),
Limit: float64(cfg.RateLimit),
DisableBackSource: cfg.DisableBackSource,
UrlMeta: &base.UrlMeta{
Digest: cfg.Digest,
Tag: cfg.Tag,
Range: hdr[dfheaders.Range],
Filter: cfg.Filter,
Header: hdr,
},
Pattern: cfg.Pattern,
Callsystem: cfg.CallSystem,
Uid: int64(basic.UserID),
Gid: int64(basic.UserGroup),
}
}
func newProgressBar(max int64) *progressbar.ProgressBar {
return progressbar.NewOptions64(max,
progressbar.OptionShowBytes(true),
progressbar.OptionShowIts(),
progressbar.OptionSetPredictTime(true),
progressbar.OptionUseANSICodes(true),
progressbar.OptionEnableColorCodes(true),
progressbar.OptionFullWidth(),
progressbar.OptionSetDescription("[cyan]Downloading...[reset]"),
progressbar.OptionSetRenderBlankState(true),
progressbar.OptionSetTheme(progressbar.Theme{
Saucer: "[green]=[reset]",
SaucerHead: "[green]>[reset]",
SaucerPadding: " ",
BarStart: "[",
BarEnd: "]",
}))
}

View File

@ -0,0 +1,59 @@
/*
* Copyright 2020 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dfget
import (
"context"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"d7y.io/dragonfly/v2/client/config"
"d7y.io/dragonfly/v2/internal/constants"
"d7y.io/dragonfly/v2/internal/idgen"
"d7y.io/dragonfly/v2/pkg/source"
sourcemock "d7y.io/dragonfly/v2/pkg/source/mock"
"d7y.io/dragonfly/v2/pkg/util/digestutils"
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
)
func Test_downloadFromSource(t *testing.T) {
homeDir, err := os.UserHomeDir()
assert.Nil(t, err)
output := filepath.Join(homeDir, idgen.UUIDString())
defer os.Remove(output)
content := idgen.UUIDString()
sourceClient := sourcemock.NewMockResourceClient(gomock.NewController(t))
source.Register("http", sourceClient)
defer source.UnRegister("http")
cfg := &config.DfgetConfig{
URL: "http://a.b.c/xx",
Output: output,
Digest: strings.Join([]string{constants.Sha256Hash, digestutils.Sha256(content)}, ":"),
}
sourceClient.EXPECT().Download(context.Background(), cfg.URL, nil).Return(ioutil.NopCloser(strings.NewReader(content)), nil)
err = downloadFromSource(context.Background(), cfg, nil)
assert.Nil(t, err)
}

View File

@ -18,10 +18,9 @@ package main
import ( import (
"d7y.io/dragonfly/v2/cmd/cdn/cmd" "d7y.io/dragonfly/v2/cmd/cdn/cmd"
// Register http client
// Init http client
_ "d7y.io/dragonfly/v2/pkg/source/httpprotocol" _ "d7y.io/dragonfly/v2/pkg/source/httpprotocol"
// Init OSS client // Register oss client
_ "d7y.io/dragonfly/v2/pkg/source/ossprotocol" _ "d7y.io/dragonfly/v2/pkg/source/ossprotocol"
) )

View File

@ -212,7 +212,7 @@ func initDecoderConfig(dc *mapstructure.DecoderConfig) {
default: default:
return v, nil return v, nil
} }
}, mapstructure.StringToSliceHookFunc("&"), dc.DecodeHook) }, dc.DecodeHook)
} }
// initTracer creates a new trace provider instance and registers it as global trace provider. // initTracer creates a new trace provider instance and registers it as global trace provider.

View File

@ -104,10 +104,19 @@ func runDaemon() error {
// Otherwise, wait 50 ms and execute again from 1 // Otherwise, wait 50 ms and execute again from 1
// 4. Checking timeout about 5s // 4. Checking timeout about 5s
lock := flock.New(dfpath.DaemonLockPath) lock := flock.New(dfpath.DaemonLockPath)
times := 0 timeout := time.After(5 * time.Second)
limit := 100 // 100 * 50ms = 5s first := time.After(1 * time.Millisecond)
interval := 50 * time.Millisecond tick := time.NewTicker(50 * time.Millisecond)
defer tick.Stop()
for { for {
select {
case <-timeout:
return errors.New("the daemon is unhealthy")
case <-first:
case <-tick.C:
}
if ok, err := lock.TryLock(); err != nil { if ok, err := lock.TryLock(); err != nil {
return err return err
} else if !ok { } else if !ok {
@ -117,13 +126,6 @@ func runDaemon() error {
} else { } else {
break break
} }
times++
if times > limit {
return errors.New("the daemon is unhealthy")
}
time.Sleep(interval)
} }
defer lock.Unlock() defer lock.Unlock()

View File

@ -22,19 +22,22 @@ import (
"os" "os"
"os/exec" "os/exec"
"strconv" "strconv"
"strings"
"syscall" "syscall"
"time" "time"
"d7y.io/dragonfly/v2/client/config" "d7y.io/dragonfly/v2/client/config"
"d7y.io/dragonfly/v2/client/dfget" "d7y.io/dragonfly/v2/client/dfget"
"d7y.io/dragonfly/v2/cmd/dependency" "d7y.io/dragonfly/v2/cmd/dependency"
"d7y.io/dragonfly/v2/internal/constants"
logger "d7y.io/dragonfly/v2/internal/dflog" logger "d7y.io/dragonfly/v2/internal/dflog"
"d7y.io/dragonfly/v2/internal/dflog/logcore" "d7y.io/dragonfly/v2/internal/dflog/logcore"
"d7y.io/dragonfly/v2/internal/dfpath" "d7y.io/dragonfly/v2/internal/dfpath"
"d7y.io/dragonfly/v2/pkg/basic"
"d7y.io/dragonfly/v2/pkg/basic/dfnet" "d7y.io/dragonfly/v2/pkg/basic/dfnet"
"d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client" "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon/client"
"d7y.io/dragonfly/v2/pkg/unit" "d7y.io/dragonfly/v2/pkg/unit"
"d7y.io/dragonfly/v2/pkg/util/net/iputils"
"d7y.io/dragonfly/v2/version"
"github.com/gofrs/flock" "github.com/gofrs/flock"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -62,6 +65,8 @@ var rootCmd = &cobra.Command{
DisableAutoGenTag: true, DisableAutoGenTag: true,
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true}, FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
start := time.Now()
if err := logcore.InitDfget(dfgetConfig.Console); err != nil { if err := logcore.InitDfget(dfgetConfig.Console); err != nil {
return errors.Wrap(err, "init client dfget logger") return errors.Wrap(err, "init client dfget logger")
} }
@ -76,8 +81,18 @@ var rootCmd = &cobra.Command{
return err return err
} }
fmt.Printf("--%s-- %s\n", start.Format("2006-01-02 15:04:05"), dfgetConfig.URL)
fmt.Printf("current user[%s] output path[%s]\n", basic.Username, dfgetConfig.Output)
fmt.Printf("dfget version[%s] default peer ip[%s]\n", version.GitVersion, iputils.HostIP)
// do get file // do get file
return runDfget() err := runDfget()
msg := fmt.Sprintf("download success:%t cost:%dms error:[%v]", err == nil, time.Now().Sub(start).Milliseconds(), err)
logger.With("url", dfgetConfig.URL).Info(msg)
fmt.Println(msg)
return errors.Wrapf(err, "download url[%s]", dfgetConfig.URL)
}, },
} }
@ -86,7 +101,6 @@ var rootCmd = &cobra.Command{
func Execute() { func Execute() {
if err := rootCmd.Execute(); err != nil { if err := rootCmd.Execute(); err != nil {
logger.Error(err) logger.Error(err)
fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
} }
@ -101,45 +115,36 @@ func init() {
flagSet := rootCmd.Flags() flagSet := rootCmd.Flags()
flagSet.StringP("url", "u", dfgetConfig.URL, flagSet.StringP("url", "u", dfgetConfig.URL,
"download a file from the url, equivalent to the command's first position argument") "Download one file from the url, equivalent to the command's first position argument")
flagSet.StringP("output", "O", dfgetConfig.Output, flagSet.StringP("output", "O", dfgetConfig.Output,
"destination path which is used to store the downloaded file. It must be a full path, for example, '/tmp/file.mp4'") "Destination path which is used to store the downloaded file, it must be a full path")
flagSet.DurationP("timeout", "e", dfgetConfig.Timeout, flagSet.Duration("timeout", dfgetConfig.Timeout, "Timeout for the downloading task, 0 is infinite")
"timeout for file downloading task. If dfget has not finished downloading all pieces of file "+
"before --timeout, the dfget will throw an error and exit, 0 is infinite")
flagSet.String("limit", unit.Bytes(dfgetConfig.RateLimit).String(), flagSet.String("limit", unit.Bytes(dfgetConfig.RateLimit).String(),
"network bandwidth rate limit in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will be parsed as Byte, 0 is infinite") "The downloading network bandwidth limit per second in format of G(B)/g/M(B)/m/K(B)/k/B, pure number will be parsed as Byte, 0 is infinite")
flagSet.String("digest", dfgetConfig.Digest, flagSet.String("digest", dfgetConfig.Digest,
"digest is used to check the integrity of the downloaded file, in format of md5:xxx or sha256:yyy") "Check the integrity of the downloaded file with digest, in format of md5:xxx or sha256:yyy")
flagSet.StringP("identifier", "i", dfgetConfig.Identifier, flagSet.String("tag", dfgetConfig.Tag,
"different identifiers for the same url will be divided into different P2P tasks, it conflicts with --digest") "Different tags for the same url will be divided into different P2P overlay, it conflicts with --digest")
flagSet.StringP("filter", "f", strings.Join(dfgetConfig.Filter, "&"), flagSet.String("filter", dfgetConfig.Filter,
"filter some query params of url, use char '&' to separate different params, eg: -f 'key&sign' "+ "Filter the query parameters of the url, P2P overlay is the same one if the filtered url is same, "+
"will filter 'key' and 'sign' query param. in this way, different urls can correspond to the same P2P task") "in format of key&sign, which will filter 'key' and 'sign' query parameters")
flagSet.Bool("disable-back-source", dfgetConfig.DisableBackSource,
"disable dfget downloading file directly from url source when peer fails to download file, "+
"--limit is invalid when peer downloads the file from source")
flagSet.StringP("pattern", "p", dfgetConfig.Pattern, "downloading pattern, must be p2p/cdn/source")
flagSet.StringArrayP("header", "H", dfgetConfig.Header, "url header, eg: --header='Accept: *' --header='Host: abc'") flagSet.StringArrayP("header", "H", dfgetConfig.Header, "url header, eg: --header='Accept: *' --header='Host: abc'")
flagSet.StringArray("cacerts", dfgetConfig.Cacerts, flagSet.Bool("disable-back-source", dfgetConfig.DisableBackSource,
"cacert files is used to verify CA for remote server when dragonfly interacts with the url source") "Disable downloading directly from source when the daemon fails to download file")
flagSet.Bool("insecure", dfgetConfig.Insecure, flagSet.StringP("pattern", "p", dfgetConfig.Pattern, "The downloading pattern: p2p/cdn/source")
"identify whether dragonfly should skip CA verification for remote server when it interacts with the url source")
flagSet.BoolP("show-progress", "b", dfgetConfig.ShowBar, "show progress bar, it conflicts with --console") flagSet.BoolP("show-progress", "b", dfgetConfig.ShowProgress, "Show progress bar, it conflicts with --console")
flagSet.String("callsystem", dfgetConfig.CallSystem, "the system name of dfget caller which is mainly used for statistics and access control") flagSet.String("callsystem", dfgetConfig.CallSystem, "The caller name which is mainly used for statistics and access control")
// Bind cmd flags // Bind cmd flags
if err := viper.BindPFlags(flagSet); err != nil { if err := viper.BindPFlags(flagSet); err != nil {
@ -156,17 +161,24 @@ func runDfget() error {
ff := dependency.InitMonitor(dfgetConfig.Verbose, dfgetConfig.PProfPort, dfgetConfig.Telemetry.Jaeger) ff := dependency.InitMonitor(dfgetConfig.Verbose, dfgetConfig.PProfPort, dfgetConfig.Telemetry.Jaeger)
defer ff() defer ff()
logger.Info("start to check and spawn daemon") var (
daemonClient, err := checkAndSpawnDaemon() daemonClient client.DaemonClient
if err != nil { err error
logger.Errorf("check and spawn daemon error:%v", err) )
} else {
logger.Info("check and spawn daemon success") if dfgetConfig.Pattern != constants.SourcePattern {
logger.Info("start to check and spawn daemon")
if daemonClient, err = checkAndSpawnDaemon(); err != nil {
logger.Errorf("check and spawn daemon error:%v", err)
} else {
logger.Info("check and spawn daemon success")
}
} }
return dfget.Download(dfgetConfig, daemonClient) return dfget.Download(dfgetConfig, daemonClient)
} }
// checkAndSpawnDaemon do checking at four checkpoints // checkAndSpawnDaemon do checking at three checkpoints
func checkAndSpawnDaemon() (client.DaemonClient, error) { func checkAndSpawnDaemon() (client.DaemonClient, error) {
target := dfnet.NetAddr{Type: dfnet.UNIX, Addr: dfpath.DaemonSockPath} target := dfnet.NetAddr{Type: dfnet.UNIX, Addr: dfpath.DaemonSockPath}
daemonClient, err := client.GetClientByAddr([]dfnet.NetAddr{target}) daemonClient, err := client.GetClientByAddr([]dfnet.NetAddr{target})
@ -202,14 +214,15 @@ func checkAndSpawnDaemon() (client.DaemonClient, error) {
} }
// 3. check health with at least 5s timeout // 3. check health with at least 5s timeout
tick := time.Tick(50 * time.Millisecond) tick := time.NewTicker(50 * time.Millisecond)
defer tick.Stop()
timeout := time.After(5 * time.Second) timeout := time.After(5 * time.Second)
for { for {
select { select {
case <-timeout: case <-timeout:
return nil, errors.New("the daemon is unhealthy") return nil, errors.New("the daemon is unhealthy")
case <-tick: case <-tick.C:
if err = daemonClient.CheckHealth(context.Background(), target); err != nil { if err = daemonClient.CheckHealth(context.Background(), target); err != nil {
continue continue
} }

View File

@ -18,9 +18,9 @@ package main
import ( import (
"d7y.io/dragonfly/v2/cmd/dfget/cmd" "d7y.io/dragonfly/v2/cmd/dfget/cmd"
// Init http client // Register http client
_ "d7y.io/dragonfly/v2/pkg/source/httpprotocol" _ "d7y.io/dragonfly/v2/pkg/source/httpprotocol"
// Init OSS client // Register oss client
_ "d7y.io/dragonfly/v2/pkg/source/ossprotocol" _ "d7y.io/dragonfly/v2/pkg/source/ossprotocol"
) )

13
go.mod
View File

@ -10,7 +10,7 @@ require (
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
github.com/docker/go-units v0.4.0 github.com/docker/go-units v0.4.0
github.com/emirpasic/gods v1.12.0 github.com/emirpasic/gods v1.12.0
github.com/envoyproxy/protoc-gen-validate v0.1.0 github.com/envoyproxy/protoc-gen-validate v0.6.1
github.com/gin-gonic/gin v1.6.3 github.com/gin-gonic/gin v1.6.3
github.com/go-echarts/statsview v0.3.4 github.com/go-echarts/statsview v0.3.4
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a
@ -20,24 +20,22 @@ require (
github.com/gofrs/flock v0.8.0 github.com/gofrs/flock v0.8.0
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/golang/mock v1.6.0 github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.4.3 github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.1.5 github.com/google/uuid v1.1.5
github.com/gorilla/mux v1.7.3 github.com/gorilla/mux v1.7.3
github.com/jarcoal/httpmock v1.0.8 github.com/jarcoal/httpmock v1.0.8
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.9
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
github.com/mcuadros/go-gin-prometheus v0.1.0 github.com/mcuadros/go-gin-prometheus v0.1.0
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
github.com/mitchellh/mapstructure v1.4.1 github.com/mitchellh/mapstructure v1.4.1
github.com/olekukonko/tablewriter v0.0.5 github.com/olekukonko/tablewriter v0.0.5
github.com/pborman/uuid v1.2.1 github.com/pborman/uuid v1.2.1
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/schollz/progressbar/v3 v3.8.2
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b
github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus v1.4.2
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v1.1.1 github.com/spf13/cobra v1.1.1
github.com/spf13/viper v1.7.1 github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0 github.com/stretchr/testify v1.7.0
@ -49,12 +47,11 @@ require (
go.uber.org/atomic v1.6.0 go.uber.org/atomic v1.6.0
go.uber.org/zap v1.16.0 go.uber.org/zap v1.16.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf
golang.org/x/text v0.3.5 // indirect golang.org/x/text v0.3.5 // indirect
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 golang.org/x/time v0.0.0-20201208040808-7e3f01d25324
google.golang.org/grpc v1.36.0 google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.0 google.golang.org/protobuf v1.26.0
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776

43
go.sum
View File

@ -83,6 +83,8 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m
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.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v0.6.1 h1:4CF52PCseTFt4bE+Yk3dIpdVi7XWuPVMhPtm4FaIJPM=
github.com/envoyproxy/protoc-gen-validate v0.6.1/go.mod h1:txg5va2Qkip90uYoSKH+nkAAmXrb2j3iq4FLwdrCbXQ=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
@ -162,6 +164,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/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.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA=
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 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 v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@ -219,6 +224,7 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=
@ -289,6 +295,7 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
@ -297,6 +304,7 @@ github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/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/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.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
@ -315,6 +323,7 @@ github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lyft/protoc-gen-star v0.5.1/go.mod h1:9toiA3cC7z5uVbODF7kEQ91Xn7XNFkVUl+SrEe+ZORU=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
@ -330,8 +339,12 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw= github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw=
github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
@ -391,6 +404,7 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
@ -408,6 +422,8 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084 h1:sofwID9zm4tzrgykg80hfFph1mryUeLRsUfoocVVmRY=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
@ -421,6 +437,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/schollz/progressbar/v3 v3.8.2 h1:2kZJwZCpb+E/V79kGO7daeq+hUwUJW0A5QD1Wv455dA=
github.com/schollz/progressbar/v3 v3.8.2/go.mod h1:9KHLdyuXczIsyStQwzvW8xiELskmX7fQMaZdN23nAv8=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b h1:h+3JX2VoWTFuyQEo87pStk/a99dzIO1mM9KxIyLPGTU= github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b h1:h+3JX2VoWTFuyQEo87pStk/a99dzIO1mM9KxIyLPGTU=
github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc=
@ -439,8 +457,9 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.4 h1:8q6vk3hthlpb2SouZcnBVKboxWQWMDNF38bwholZrJc=
github.com/spf13/afero v1.3.4/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4=
@ -487,6 +506,7 @@ github.com/vmihailenco/msgpack/v5 v5.1.0/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZ
github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc=
github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/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.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
@ -534,6 +554,8 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 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-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-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -552,6 +574,8 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/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 h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/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-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/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-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/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4=
@ -559,6 +583,7 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= 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.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
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.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
@ -581,6 +606,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/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-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
@ -597,6 +623,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/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-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-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-20201020160332-67f06af15bc9/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
@ -636,9 +663,12 @@ golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/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 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio=
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@ -676,7 +706,9 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/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-20200207183749-b753a1ba74fa/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-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs=
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
@ -725,6 +757,9 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/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.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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 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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -4,8 +4,10 @@ SRC="$(cd "$(dirname "$0")/.." && pwd)"
echo "work dir:$SRC" echo "work dir:$SRC"
if protoc -I="$SRC" \ if protoc -I="$SRC" \
-I $GOPATH/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v0.6.1 \
--go_out "$SRC" --go_opt paths=source_relative \ --go_out "$SRC" --go_opt paths=source_relative \
--go-grpc_out "$SRC" --go-grpc_opt paths=source_relative \ --go-grpc_out "$SRC" --go-grpc_opt paths=source_relative \
--validate_out "lang=go,paths=source_relative:$SRC" \
"$SRC"/pkg/rpc/base/*.proto \ "$SRC"/pkg/rpc/base/*.proto \
"$SRC"/pkg/rpc/cdnsystem/*.proto \ "$SRC"/pkg/rpc/cdnsystem/*.proto \
"$SRC"/pkg/rpc/dfdaemon/*.proto \ "$SRC"/pkg/rpc/dfdaemon/*.proto \

View File

@ -0,0 +1,27 @@
/*
* Copyright 2020 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package constants
const (
// download pattern
SourcePattern = "source"
CDNPattern = "cdn"
P2PPattern = "p2p"
Sha256Hash = "sha256"
Md5Hash = "md5"
)

View File

@ -0,0 +1,21 @@
/*
* Copyright 2020 The Dragonfly Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dfheaders
const (
Range = "Range"
)

View File

@ -105,19 +105,23 @@ func (log *SugaredLoggerOnWith) Infof(template string, args ...interface{}) {
} }
func (log *SugaredLoggerOnWith) Info(args ...interface{}) { func (log *SugaredLoggerOnWith) Info(args ...interface{}) {
CoreLogger.Info(append(args, log.withArgs...)...) CoreLogger.Infow(fmt.Sprint(args...), log.withArgs...)
} }
func (log *SugaredLoggerOnWith) Warnf(template string, args ...interface{}) { func (log *SugaredLoggerOnWith) Warnf(template string, args ...interface{}) {
CoreLogger.Warnw(fmt.Sprintf(template, args...), log.withArgs...) CoreLogger.Warnw(fmt.Sprintf(template, args...), log.withArgs...)
} }
func (log *SugaredLoggerOnWith) Warn(args ...interface{}) {
CoreLogger.Warnw(fmt.Sprint(args...), log.withArgs...)
}
func (log *SugaredLoggerOnWith) Errorf(template string, args ...interface{}) { func (log *SugaredLoggerOnWith) Errorf(template string, args ...interface{}) {
CoreLogger.Errorw(fmt.Sprintf(template, args...), log.withArgs...) CoreLogger.Errorw(fmt.Sprintf(template, args...), log.withArgs...)
} }
func (log *SugaredLoggerOnWith) Error(args ...interface{}) { func (log *SugaredLoggerOnWith) Error(args ...interface{}) {
CoreLogger.Error(append(args, log.withArgs...)...) CoreLogger.Errorw(fmt.Sprint(args...), log.withArgs...)
} }
func (log *SugaredLoggerOnWith) Debugf(template string, args ...interface{}) { func (log *SugaredLoggerOnWith) Debugf(template string, args ...interface{}) {

View File

@ -15,14 +15,13 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.26.0
// protoc v3.15.8 // protoc v3.15.8
// source: internal/rpc/base/base.proto // source: pkg/rpc/base/base.proto
package base package base
import ( import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
@ -36,10 +35,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type Code int32 type Code int32
const ( const (
@ -67,11 +62,11 @@ func (x Code) String() string {
} }
func (Code) Descriptor() protoreflect.EnumDescriptor { func (Code) Descriptor() protoreflect.EnumDescriptor {
return file_internal_rpc_base_base_proto_enumTypes[0].Descriptor() return file_pkg_rpc_base_base_proto_enumTypes[0].Descriptor()
} }
func (Code) Type() protoreflect.EnumType { func (Code) Type() protoreflect.EnumType {
return &file_internal_rpc_base_base_proto_enumTypes[0] return &file_pkg_rpc_base_base_proto_enumTypes[0]
} }
func (x Code) Number() protoreflect.EnumNumber { func (x Code) Number() protoreflect.EnumNumber {
@ -80,7 +75,7 @@ func (x Code) Number() protoreflect.EnumNumber {
// Deprecated: Use Code.Descriptor instead. // Deprecated: Use Code.Descriptor instead.
func (Code) EnumDescriptor() ([]byte, []int) { func (Code) EnumDescriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{0} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{0}
} }
type PieceStyle int32 type PieceStyle int32
@ -110,11 +105,11 @@ func (x PieceStyle) String() string {
} }
func (PieceStyle) Descriptor() protoreflect.EnumDescriptor { func (PieceStyle) Descriptor() protoreflect.EnumDescriptor {
return file_internal_rpc_base_base_proto_enumTypes[1].Descriptor() return file_pkg_rpc_base_base_proto_enumTypes[1].Descriptor()
} }
func (PieceStyle) Type() protoreflect.EnumType { func (PieceStyle) Type() protoreflect.EnumType {
return &file_internal_rpc_base_base_proto_enumTypes[1] return &file_pkg_rpc_base_base_proto_enumTypes[1]
} }
func (x PieceStyle) Number() protoreflect.EnumNumber { func (x PieceStyle) Number() protoreflect.EnumNumber {
@ -123,7 +118,7 @@ func (x PieceStyle) Number() protoreflect.EnumNumber {
// Deprecated: Use PieceStyle.Descriptor instead. // Deprecated: Use PieceStyle.Descriptor instead.
func (PieceStyle) EnumDescriptor() ([]byte, []int) { func (PieceStyle) EnumDescriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{1} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{1}
} }
type SizeScope int32 type SizeScope int32
@ -162,11 +157,11 @@ func (x SizeScope) String() string {
} }
func (SizeScope) Descriptor() protoreflect.EnumDescriptor { func (SizeScope) Descriptor() protoreflect.EnumDescriptor {
return file_internal_rpc_base_base_proto_enumTypes[2].Descriptor() return file_pkg_rpc_base_base_proto_enumTypes[2].Descriptor()
} }
func (SizeScope) Type() protoreflect.EnumType { func (SizeScope) Type() protoreflect.EnumType {
return &file_internal_rpc_base_base_proto_enumTypes[2] return &file_pkg_rpc_base_base_proto_enumTypes[2]
} }
func (x SizeScope) Number() protoreflect.EnumNumber { func (x SizeScope) Number() protoreflect.EnumNumber {
@ -175,7 +170,7 @@ func (x SizeScope) Number() protoreflect.EnumNumber {
// Deprecated: Use SizeScope.Descriptor instead. // Deprecated: Use SizeScope.Descriptor instead.
func (SizeScope) EnumDescriptor() ([]byte, []int) { func (SizeScope) EnumDescriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{2} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{2}
} }
type GrpcDfError struct { type GrpcDfError struct {
@ -190,7 +185,7 @@ type GrpcDfError struct {
func (x *GrpcDfError) Reset() { func (x *GrpcDfError) Reset() {
*x = GrpcDfError{} *x = GrpcDfError{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[0] mi := &file_pkg_rpc_base_base_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -203,7 +198,7 @@ func (x *GrpcDfError) String() string {
func (*GrpcDfError) ProtoMessage() {} func (*GrpcDfError) ProtoMessage() {}
func (x *GrpcDfError) ProtoReflect() protoreflect.Message { func (x *GrpcDfError) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[0] mi := &file_pkg_rpc_base_base_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -216,7 +211,7 @@ func (x *GrpcDfError) ProtoReflect() protoreflect.Message {
// Deprecated: Use GrpcDfError.ProtoReflect.Descriptor instead. // Deprecated: Use GrpcDfError.ProtoReflect.Descriptor instead.
func (*GrpcDfError) Descriptor() ([]byte, []int) { func (*GrpcDfError) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{0} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{0}
} }
func (x *GrpcDfError) GetCode() Code { func (x *GrpcDfError) GetCode() Code {
@ -254,7 +249,7 @@ type UrlMeta struct {
func (x *UrlMeta) Reset() { func (x *UrlMeta) Reset() {
*x = UrlMeta{} *x = UrlMeta{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[1] mi := &file_pkg_rpc_base_base_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -267,7 +262,7 @@ func (x *UrlMeta) String() string {
func (*UrlMeta) ProtoMessage() {} func (*UrlMeta) ProtoMessage() {}
func (x *UrlMeta) ProtoReflect() protoreflect.Message { func (x *UrlMeta) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[1] mi := &file_pkg_rpc_base_base_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -280,7 +275,7 @@ func (x *UrlMeta) ProtoReflect() protoreflect.Message {
// Deprecated: Use UrlMeta.ProtoReflect.Descriptor instead. // Deprecated: Use UrlMeta.ProtoReflect.Descriptor instead.
func (*UrlMeta) Descriptor() ([]byte, []int) { func (*UrlMeta) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{1} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{1}
} }
func (x *UrlMeta) GetDigest() string { func (x *UrlMeta) GetDigest() string {
@ -334,7 +329,7 @@ type HostLoad struct {
func (x *HostLoad) Reset() { func (x *HostLoad) Reset() {
*x = HostLoad{} *x = HostLoad{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[2] mi := &file_pkg_rpc_base_base_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -347,7 +342,7 @@ func (x *HostLoad) String() string {
func (*HostLoad) ProtoMessage() {} func (*HostLoad) ProtoMessage() {}
func (x *HostLoad) ProtoReflect() protoreflect.Message { func (x *HostLoad) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[2] mi := &file_pkg_rpc_base_base_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -360,7 +355,7 @@ func (x *HostLoad) ProtoReflect() protoreflect.Message {
// Deprecated: Use HostLoad.ProtoReflect.Descriptor instead. // Deprecated: Use HostLoad.ProtoReflect.Descriptor instead.
func (*HostLoad) Descriptor() ([]byte, []int) { func (*HostLoad) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{2} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{2}
} }
func (x *HostLoad) GetCpuRatio() float32 { func (x *HostLoad) GetCpuRatio() float32 {
@ -401,7 +396,7 @@ type PieceTaskRequest struct {
func (x *PieceTaskRequest) Reset() { func (x *PieceTaskRequest) Reset() {
*x = PieceTaskRequest{} *x = PieceTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[3] mi := &file_pkg_rpc_base_base_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -414,7 +409,7 @@ func (x *PieceTaskRequest) String() string {
func (*PieceTaskRequest) ProtoMessage() {} func (*PieceTaskRequest) ProtoMessage() {}
func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message { func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[3] mi := &file_pkg_rpc_base_base_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -427,7 +422,7 @@ func (x *PieceTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use PieceTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use PieceTaskRequest.ProtoReflect.Descriptor instead.
func (*PieceTaskRequest) Descriptor() ([]byte, []int) { func (*PieceTaskRequest) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{3} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{3}
} }
func (x *PieceTaskRequest) GetTaskId() string { func (x *PieceTaskRequest) GetTaskId() string {
@ -481,7 +476,7 @@ type PieceInfo struct {
func (x *PieceInfo) Reset() { func (x *PieceInfo) Reset() {
*x = PieceInfo{} *x = PieceInfo{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[4] mi := &file_pkg_rpc_base_base_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -494,7 +489,7 @@ func (x *PieceInfo) String() string {
func (*PieceInfo) ProtoMessage() {} func (*PieceInfo) ProtoMessage() {}
func (x *PieceInfo) ProtoReflect() protoreflect.Message { func (x *PieceInfo) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[4] mi := &file_pkg_rpc_base_base_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -507,7 +502,7 @@ func (x *PieceInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use PieceInfo.ProtoReflect.Descriptor instead. // Deprecated: Use PieceInfo.ProtoReflect.Descriptor instead.
func (*PieceInfo) Descriptor() ([]byte, []int) { func (*PieceInfo) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{4} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{4}
} }
func (x *PieceInfo) GetPieceNum() int32 { func (x *PieceInfo) GetPieceNum() int32 {
@ -572,7 +567,7 @@ type PiecePacket struct {
func (x *PiecePacket) Reset() { func (x *PiecePacket) Reset() {
*x = PiecePacket{} *x = PiecePacket{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_base_base_proto_msgTypes[5] mi := &file_pkg_rpc_base_base_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -585,7 +580,7 @@ func (x *PiecePacket) String() string {
func (*PiecePacket) ProtoMessage() {} func (*PiecePacket) ProtoMessage() {}
func (x *PiecePacket) ProtoReflect() protoreflect.Message { func (x *PiecePacket) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_base_base_proto_msgTypes[5] mi := &file_pkg_rpc_base_base_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -598,7 +593,7 @@ func (x *PiecePacket) ProtoReflect() protoreflect.Message {
// Deprecated: Use PiecePacket.ProtoReflect.Descriptor instead. // Deprecated: Use PiecePacket.ProtoReflect.Descriptor instead.
func (*PiecePacket) Descriptor() ([]byte, []int) { func (*PiecePacket) Descriptor() ([]byte, []int) {
return file_internal_rpc_base_base_proto_rawDescGZIP(), []int{5} return file_pkg_rpc_base_base_proto_rawDescGZIP(), []int{5}
} }
func (x *PiecePacket) GetTaskId() string { func (x *PiecePacket) GetTaskId() string {
@ -650,101 +645,100 @@ func (x *PiecePacket) GetPieceMd5Sign() string {
return "" return ""
} }
var File_internal_rpc_base_base_proto protoreflect.FileDescriptor var File_pkg_rpc_base_base_proto protoreflect.FileDescriptor
var file_internal_rpc_base_base_proto_rawDesc = []byte{ var file_pkg_rpc_base_base_proto_rawDesc = []byte{
0x0a, 0x1c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x0a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62,
0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x62, 0x61, 0x73, 0x65, 0x22,
0x62, 0x61, 0x73, 0x65, 0x22, 0x47, 0x0a, 0x0b, 0x47, 0x72, 0x70, 0x63, 0x44, 0x66, 0x45, 0x72, 0x47, 0x0a, 0x0b, 0x47, 0x72, 0x70, 0x63, 0x44, 0x66, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e,
0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62,
0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18,
0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xcf, 0x01, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xcf, 0x01, 0x0a, 0x07, 0x55, 0x72, 0x6c,
0x0a, 0x07, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01,
0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03,
0x74, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x14,
0x74, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x0a, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x72,
0x28, 0x09, 0x52, 0x05, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04,
0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x06,
0x72, 0x12, 0x31, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62,
0x0b, 0x32, 0x19, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64,
0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a,
0x61, 0x64, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x39, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x63, 0x0a, 0x08, 0x48, 0x6f,
0x63, 0x0a, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x72, 0x61,
0x70, 0x75, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x74, 0x69, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x63, 0x70, 0x75, 0x52, 0x61,
0x63, 0x70, 0x75, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x74, 0x69, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x52, 0x61, 0x74, 0x69, 0x6f,
0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x6b, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x03,
0x74, 0x69, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x52, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x64, 0x69, 0x73, 0x6b, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x22,
0x61, 0x74, 0x69, 0x6f, 0x22, 0x90, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x90, 0x01, 0x0a, 0x10, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71,
0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18,
0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a,
0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69,
0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12,
0x74, 0x50, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01,
0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x28, 0x05, 0x52, 0x08, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05,
0x6d, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d,
0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xdb, 0x01, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x69, 0x74, 0x22, 0xdb, 0x01, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20,
0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1f, 0x0a,
0x75, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x0b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x28, 0x04, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x1d,
0x61, 0x72, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x69, 0x28, 0x05, 0x52, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a,
0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x18, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x12, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x69,
0x21, 0x0a, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x65, 0x63, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04,
0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x52, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x31, 0x0a,
0x65, 0x74, 0x12, 0x31, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01,
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53,
0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65,
0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0xfa, 0x01, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x22, 0xfa, 0x01, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74,
0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50,
0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x04,
0x64, 0x64, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x30, 0x0a,
0x64, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x0b, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x05, 0x20, 0x03,
0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49,
0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12,
0x6e, 0x66, 0x6f, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x06,
0x65, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x69, 0x65, 0x63, 0x65,
0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67,
0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x24, 0x0a, 0x0e, 0x70, 0x69, 0x65, 0x63, 0x65,
0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6d, 0x64, 0x35, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x5f, 0x6d, 0x64, 0x35, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x53, 0x69, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4d, 0x64, 0x35, 0x53, 0x69, 0x67, 0x6e, 0x2a, 0x19, 0x0a,
0x67, 0x6e, 0x2a, 0x19, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x11, 0x0a, 0x0d, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x17, 0x0a, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x2a, 0x17, 0x0a, 0x0a, 0x50, 0x69, 0x65, 0x63,
0x0a, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x65, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10,
0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x2a, 0x2c, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x00, 0x2a, 0x2c, 0x0a, 0x09, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x0a,
0x6f, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x4d,
0x09, 0x0a, 0x05, 0x53, 0x4d, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x4e, 0x59, 0x10, 0x02, 0x42,
0x4e, 0x59, 0x10, 0x02, 0x42, 0x27, 0x5a, 0x25, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x22, 0x5a, 0x20, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e,
0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62,
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x61, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
file_internal_rpc_base_base_proto_rawDescOnce sync.Once file_pkg_rpc_base_base_proto_rawDescOnce sync.Once
file_internal_rpc_base_base_proto_rawDescData = file_internal_rpc_base_base_proto_rawDesc file_pkg_rpc_base_base_proto_rawDescData = file_pkg_rpc_base_base_proto_rawDesc
) )
func file_internal_rpc_base_base_proto_rawDescGZIP() []byte { func file_pkg_rpc_base_base_proto_rawDescGZIP() []byte {
file_internal_rpc_base_base_proto_rawDescOnce.Do(func() { file_pkg_rpc_base_base_proto_rawDescOnce.Do(func() {
file_internal_rpc_base_base_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_rpc_base_base_proto_rawDescData) file_pkg_rpc_base_base_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_base_base_proto_rawDescData)
}) })
return file_internal_rpc_base_base_proto_rawDescData return file_pkg_rpc_base_base_proto_rawDescData
} }
var file_internal_rpc_base_base_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_pkg_rpc_base_base_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_internal_rpc_base_base_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_pkg_rpc_base_base_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_internal_rpc_base_base_proto_goTypes = []interface{}{ var file_pkg_rpc_base_base_proto_goTypes = []interface{}{
(Code)(0), // 0: base.Code (Code)(0), // 0: base.Code
(PieceStyle)(0), // 1: base.PieceStyle (PieceStyle)(0), // 1: base.PieceStyle
(SizeScope)(0), // 2: base.SizeScope (SizeScope)(0), // 2: base.SizeScope
@ -756,7 +750,7 @@ var file_internal_rpc_base_base_proto_goTypes = []interface{}{
(*PiecePacket)(nil), // 8: base.PiecePacket (*PiecePacket)(nil), // 8: base.PiecePacket
nil, // 9: base.UrlMeta.HeaderEntry nil, // 9: base.UrlMeta.HeaderEntry
} }
var file_internal_rpc_base_base_proto_depIdxs = []int32{ var file_pkg_rpc_base_base_proto_depIdxs = []int32{
0, // 0: base.GrpcDfError.code:type_name -> base.Code 0, // 0: base.GrpcDfError.code:type_name -> base.Code
9, // 1: base.UrlMeta.header:type_name -> base.UrlMeta.HeaderEntry 9, // 1: base.UrlMeta.header:type_name -> base.UrlMeta.HeaderEntry
1, // 2: base.PieceInfo.piece_style:type_name -> base.PieceStyle 1, // 2: base.PieceInfo.piece_style:type_name -> base.PieceStyle
@ -768,13 +762,13 @@ var file_internal_rpc_base_base_proto_depIdxs = []int32{
0, // [0:4] is the sub-list for field type_name 0, // [0:4] is the sub-list for field type_name
} }
func init() { file_internal_rpc_base_base_proto_init() } func init() { file_pkg_rpc_base_base_proto_init() }
func file_internal_rpc_base_base_proto_init() { func file_pkg_rpc_base_base_proto_init() {
if File_internal_rpc_base_base_proto != nil { if File_pkg_rpc_base_base_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_internal_rpc_base_base_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GrpcDfError); i { switch v := v.(*GrpcDfError); i {
case 0: case 0:
return &v.state return &v.state
@ -786,7 +780,7 @@ func file_internal_rpc_base_base_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_base_base_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UrlMeta); i { switch v := v.(*UrlMeta); i {
case 0: case 0:
return &v.state return &v.state
@ -798,7 +792,7 @@ func file_internal_rpc_base_base_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_base_base_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*HostLoad); i { switch v := v.(*HostLoad); i {
case 0: case 0:
return &v.state return &v.state
@ -810,7 +804,7 @@ func file_internal_rpc_base_base_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_base_base_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PieceTaskRequest); i { switch v := v.(*PieceTaskRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -822,7 +816,7 @@ func file_internal_rpc_base_base_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_base_base_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PieceInfo); i { switch v := v.(*PieceInfo); i {
case 0: case 0:
return &v.state return &v.state
@ -834,7 +828,7 @@ func file_internal_rpc_base_base_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_base_base_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_base_base_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PiecePacket); i { switch v := v.(*PiecePacket); i {
case 0: case 0:
return &v.state return &v.state
@ -851,19 +845,19 @@ func file_internal_rpc_base_base_proto_init() {
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_rpc_base_base_proto_rawDesc, RawDescriptor: file_pkg_rpc_base_base_proto_rawDesc,
NumEnums: 3, NumEnums: 3,
NumMessages: 7, NumMessages: 7,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
GoTypes: file_internal_rpc_base_base_proto_goTypes, GoTypes: file_pkg_rpc_base_base_proto_goTypes,
DependencyIndexes: file_internal_rpc_base_base_proto_depIdxs, DependencyIndexes: file_pkg_rpc_base_base_proto_depIdxs,
EnumInfos: file_internal_rpc_base_base_proto_enumTypes, EnumInfos: file_pkg_rpc_base_base_proto_enumTypes,
MessageInfos: file_internal_rpc_base_base_proto_msgTypes, MessageInfos: file_pkg_rpc_base_base_proto_msgTypes,
}.Build() }.Build()
File_internal_rpc_base_base_proto = out.File File_pkg_rpc_base_base_proto = out.File
file_internal_rpc_base_base_proto_rawDesc = nil file_pkg_rpc_base_base_proto_rawDesc = nil
file_internal_rpc_base_base_proto_goTypes = nil file_pkg_rpc_base_base_proto_goTypes = nil
file_internal_rpc_base_base_proto_depIdxs = nil file_pkg_rpc_base_base_proto_depIdxs = nil
} }

View File

@ -0,0 +1,490 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/rpc/base/base.proto
package base
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
)
// Validate checks the field values on GrpcDfError with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *GrpcDfError) Validate() error {
if m == nil {
return nil
}
// no validation rules for Code
// no validation rules for Message
return nil
}
// GrpcDfErrorValidationError is the validation error returned by
// GrpcDfError.Validate if the designated constraints aren't met.
type GrpcDfErrorValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e GrpcDfErrorValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e GrpcDfErrorValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e GrpcDfErrorValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e GrpcDfErrorValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e GrpcDfErrorValidationError) ErrorName() string { return "GrpcDfErrorValidationError" }
// Error satisfies the builtin error interface
func (e GrpcDfErrorValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sGrpcDfError.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = GrpcDfErrorValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = GrpcDfErrorValidationError{}
// Validate checks the field values on UrlMeta with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *UrlMeta) Validate() error {
if m == nil {
return nil
}
// no validation rules for Digest
// no validation rules for Tag
// no validation rules for Range
// no validation rules for Filter
// no validation rules for Header
return nil
}
// UrlMetaValidationError is the validation error returned by UrlMeta.Validate
// if the designated constraints aren't met.
type UrlMetaValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e UrlMetaValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e UrlMetaValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e UrlMetaValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e UrlMetaValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e UrlMetaValidationError) ErrorName() string { return "UrlMetaValidationError" }
// Error satisfies the builtin error interface
func (e UrlMetaValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sUrlMeta.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = UrlMetaValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = UrlMetaValidationError{}
// Validate checks the field values on HostLoad with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *HostLoad) Validate() error {
if m == nil {
return nil
}
// no validation rules for CpuRatio
// no validation rules for MemRatio
// no validation rules for DiskRatio
return nil
}
// HostLoadValidationError is the validation error returned by
// HostLoad.Validate if the designated constraints aren't met.
type HostLoadValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e HostLoadValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e HostLoadValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e HostLoadValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e HostLoadValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e HostLoadValidationError) ErrorName() string { return "HostLoadValidationError" }
// Error satisfies the builtin error interface
func (e HostLoadValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sHostLoad.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = HostLoadValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = HostLoadValidationError{}
// Validate checks the field values on PieceTaskRequest with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *PieceTaskRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for SrcPid
// no validation rules for DstPid
// no validation rules for StartNum
// no validation rules for Limit
return nil
}
// PieceTaskRequestValidationError is the validation error returned by
// PieceTaskRequest.Validate if the designated constraints aren't met.
type PieceTaskRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PieceTaskRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PieceTaskRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PieceTaskRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PieceTaskRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PieceTaskRequestValidationError) ErrorName() string { return "PieceTaskRequestValidationError" }
// Error satisfies the builtin error interface
func (e PieceTaskRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPieceTaskRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PieceTaskRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PieceTaskRequestValidationError{}
// Validate checks the field values on PieceInfo with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PieceInfo) Validate() error {
if m == nil {
return nil
}
// no validation rules for PieceNum
// no validation rules for RangeStart
// no validation rules for RangeSize
// no validation rules for PieceMd5
// no validation rules for PieceOffset
// no validation rules for PieceStyle
return nil
}
// PieceInfoValidationError is the validation error returned by
// PieceInfo.Validate if the designated constraints aren't met.
type PieceInfoValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PieceInfoValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PieceInfoValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PieceInfoValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PieceInfoValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PieceInfoValidationError) ErrorName() string { return "PieceInfoValidationError" }
// Error satisfies the builtin error interface
func (e PieceInfoValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPieceInfo.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PieceInfoValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PieceInfoValidationError{}
// Validate checks the field values on PiecePacket with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *PiecePacket) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for DstPid
// no validation rules for DstAddr
for idx, item := range m.GetPieceInfos() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PiecePacketValidationError{
field: fmt.Sprintf("PieceInfos[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for TotalPiece
// no validation rules for ContentLength
// no validation rules for PieceMd5Sign
return nil
}
// PiecePacketValidationError is the validation error returned by
// PiecePacket.Validate if the designated constraints aren't met.
type PiecePacketValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PiecePacketValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PiecePacketValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PiecePacketValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PiecePacketValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PiecePacketValidationError) ErrorName() string { return "PiecePacketValidationError" }
// Error satisfies the builtin error interface
func (e PiecePacketValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPiecePacket.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PiecePacketValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PiecePacketValidationError{}

View File

@ -18,7 +18,7 @@ syntax = "proto3";
package base; package base;
option go_package = "d7y.io/dragonfly/v2/internal/rpc/base"; option go_package = "d7y.io/dragonfly/v2/pkg/rpc/base";
enum Code{ enum Code{
X_UNSPECIFIED = 0; X_UNSPECIFIED = 0;

View File

@ -15,15 +15,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.26.0
// protoc v3.15.8 // protoc v3.15.8
// source: internal/rpc/cdnsystem/cdnsystem.proto // source: pkg/rpc/cdnsystem/cdnsystem.proto
package cdnsystem package cdnsystem
import ( import (
base "d7y.io/dragonfly/v2/pkg/rpc/base" base "d7y.io/dragonfly/v2/pkg/rpc/base"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect" reflect "reflect"
@ -37,10 +36,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type SeedRequest struct { type SeedRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -55,7 +50,7 @@ type SeedRequest struct {
func (x *SeedRequest) Reset() { func (x *SeedRequest) Reset() {
*x = SeedRequest{} *x = SeedRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[0] mi := &file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -68,7 +63,7 @@ func (x *SeedRequest) String() string {
func (*SeedRequest) ProtoMessage() {} func (*SeedRequest) ProtoMessage() {}
func (x *SeedRequest) ProtoReflect() protoreflect.Message { func (x *SeedRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[0] mi := &file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -81,7 +76,7 @@ func (x *SeedRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SeedRequest.ProtoReflect.Descriptor instead. // Deprecated: Use SeedRequest.ProtoReflect.Descriptor instead.
func (*SeedRequest) Descriptor() ([]byte, []int) { func (*SeedRequest) Descriptor() ([]byte, []int) {
return file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP(), []int{0} return file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP(), []int{0}
} }
func (x *SeedRequest) GetTaskId() string { func (x *SeedRequest) GetTaskId() string {
@ -133,7 +128,7 @@ type PieceSeed struct {
func (x *PieceSeed) Reset() { func (x *PieceSeed) Reset() {
*x = PieceSeed{} *x = PieceSeed{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[1] mi := &file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -146,7 +141,7 @@ func (x *PieceSeed) String() string {
func (*PieceSeed) ProtoMessage() {} func (*PieceSeed) ProtoMessage() {}
func (x *PieceSeed) ProtoReflect() protoreflect.Message { func (x *PieceSeed) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[1] mi := &file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -159,7 +154,7 @@ func (x *PieceSeed) ProtoReflect() protoreflect.Message {
// Deprecated: Use PieceSeed.ProtoReflect.Descriptor instead. // Deprecated: Use PieceSeed.ProtoReflect.Descriptor instead.
func (*PieceSeed) Descriptor() ([]byte, []int) { func (*PieceSeed) Descriptor() ([]byte, []int) {
return file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP(), []int{1} return file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP(), []int{1}
} }
func (x *PieceSeed) GetPeerId() string { func (x *PieceSeed) GetPeerId() string {
@ -197,61 +192,60 @@ func (x *PieceSeed) GetContentLength() int64 {
return 0 return 0
} }
var File_internal_rpc_cdnsystem_cdnsystem_proto protoreflect.FileDescriptor var File_pkg_rpc_cdnsystem_cdnsystem_proto protoreflect.FileDescriptor
var file_internal_rpc_cdnsystem_cdnsystem_proto_rawDesc = []byte{ var file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDesc = []byte{
0x0a, 0x26, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73,
0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x74, 0x65, 0x6d, 0x2f, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72,
0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x1a, 0x17,
0x74, 0x65, 0x6d, 0x1a, 0x1c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73,
0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7a, 0x0a, 0x0b, 0x53, 0x65, 0x65, 0x64, 0x52,
0x6f, 0x22, 0x7a, 0x0a, 0x0b, 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c,
0x74, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61,
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d,
0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x22, 0xb0, 0x01, 0x65, 0x74, 0x61, 0x22, 0xb0, 0x01, 0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x65, 0x65,
0x0a, 0x09, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x65, 0x65, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65,
0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x65, 0x64, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x64, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x65, 0x64, 0x65, 0x0a, 0x73, 0x65, 0x65, 0x64, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x0a, 0x70,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x6e, 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12,
0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74,
0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x32, 0x83, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x65, 0x64, 0x65,
0x32, 0x83, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x65, 0x64, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x4f, 0x72, 0x12, 0x3d, 0x0a, 0x0b, 0x4f, 0x62, 0x74, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x73,
0x62, 0x74, 0x61, 0x69, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x73, 0x12, 0x16, 0x2e, 0x63, 0x64, 0x6e, 0x12, 0x16, 0x2e, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x65,
0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x63, 0x64, 0x6e, 0x73, 0x79,
0x73, 0x74, 0x1a, 0x14, 0x2e, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x50, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x53, 0x65, 0x65, 0x64, 0x30, 0x01,
0x69, 0x65, 0x63, 0x65, 0x53, 0x65, 0x65, 0x64, 0x30, 0x01, 0x12, 0x3a, 0x0a, 0x0d, 0x47, 0x65, 0x12, 0x3a, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b,
0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x16, 0x2e, 0x62, 0x61, 0x73, 0x12, 0x16, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61,
0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x61, 0x73, 0x65,
0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x27, 0x5a, 0x25,
0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x2c, 0x5a, 0x2a, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79,
0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x2f, 0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x64, 0x6e, 0x73,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x64, 0x6e, 0x73, 0x79, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x73, 0x74, 0x65, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescOnce sync.Once file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescOnce sync.Once
file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescData = file_internal_rpc_cdnsystem_cdnsystem_proto_rawDesc file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescData = file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDesc
) )
func file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP() []byte { func file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescGZIP() []byte {
file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescOnce.Do(func() { file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescOnce.Do(func() {
file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescData) file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescData)
}) })
return file_internal_rpc_cdnsystem_cdnsystem_proto_rawDescData return file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDescData
} }
var file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_internal_rpc_cdnsystem_cdnsystem_proto_goTypes = []interface{}{ var file_pkg_rpc_cdnsystem_cdnsystem_proto_goTypes = []interface{}{
(*SeedRequest)(nil), // 0: cdnsystem.SeedRequest (*SeedRequest)(nil), // 0: cdnsystem.SeedRequest
(*PieceSeed)(nil), // 1: cdnsystem.PieceSeed (*PieceSeed)(nil), // 1: cdnsystem.PieceSeed
(*base.UrlMeta)(nil), // 2: base.UrlMeta (*base.UrlMeta)(nil), // 2: base.UrlMeta
@ -259,7 +253,7 @@ var file_internal_rpc_cdnsystem_cdnsystem_proto_goTypes = []interface{}{
(*base.PieceTaskRequest)(nil), // 4: base.PieceTaskRequest (*base.PieceTaskRequest)(nil), // 4: base.PieceTaskRequest
(*base.PiecePacket)(nil), // 5: base.PiecePacket (*base.PiecePacket)(nil), // 5: base.PiecePacket
} }
var file_internal_rpc_cdnsystem_cdnsystem_proto_depIdxs = []int32{ var file_pkg_rpc_cdnsystem_cdnsystem_proto_depIdxs = []int32{
2, // 0: cdnsystem.SeedRequest.url_meta:type_name -> base.UrlMeta 2, // 0: cdnsystem.SeedRequest.url_meta:type_name -> base.UrlMeta
3, // 1: cdnsystem.PieceSeed.piece_info:type_name -> base.PieceInfo 3, // 1: cdnsystem.PieceSeed.piece_info:type_name -> base.PieceInfo
0, // 2: cdnsystem.Seeder.ObtainSeeds:input_type -> cdnsystem.SeedRequest 0, // 2: cdnsystem.Seeder.ObtainSeeds:input_type -> cdnsystem.SeedRequest
@ -273,13 +267,13 @@ var file_internal_rpc_cdnsystem_cdnsystem_proto_depIdxs = []int32{
0, // [0:2] is the sub-list for field type_name 0, // [0:2] is the sub-list for field type_name
} }
func init() { file_internal_rpc_cdnsystem_cdnsystem_proto_init() } func init() { file_pkg_rpc_cdnsystem_cdnsystem_proto_init() }
func file_internal_rpc_cdnsystem_cdnsystem_proto_init() { func file_pkg_rpc_cdnsystem_cdnsystem_proto_init() {
if File_internal_rpc_cdnsystem_cdnsystem_proto != nil { if File_pkg_rpc_cdnsystem_cdnsystem_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SeedRequest); i { switch v := v.(*SeedRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -291,7 +285,7 @@ func file_internal_rpc_cdnsystem_cdnsystem_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PieceSeed); i { switch v := v.(*PieceSeed); i {
case 0: case 0:
return &v.state return &v.state
@ -308,18 +302,18 @@ func file_internal_rpc_cdnsystem_cdnsystem_proto_init() {
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_rpc_cdnsystem_cdnsystem_proto_rawDesc, RawDescriptor: file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 2, NumMessages: 2,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
GoTypes: file_internal_rpc_cdnsystem_cdnsystem_proto_goTypes, GoTypes: file_pkg_rpc_cdnsystem_cdnsystem_proto_goTypes,
DependencyIndexes: file_internal_rpc_cdnsystem_cdnsystem_proto_depIdxs, DependencyIndexes: file_pkg_rpc_cdnsystem_cdnsystem_proto_depIdxs,
MessageInfos: file_internal_rpc_cdnsystem_cdnsystem_proto_msgTypes, MessageInfos: file_pkg_rpc_cdnsystem_cdnsystem_proto_msgTypes,
}.Build() }.Build()
File_internal_rpc_cdnsystem_cdnsystem_proto = out.File File_pkg_rpc_cdnsystem_cdnsystem_proto = out.File
file_internal_rpc_cdnsystem_cdnsystem_proto_rawDesc = nil file_pkg_rpc_cdnsystem_cdnsystem_proto_rawDesc = nil
file_internal_rpc_cdnsystem_cdnsystem_proto_goTypes = nil file_pkg_rpc_cdnsystem_cdnsystem_proto_goTypes = nil
file_internal_rpc_cdnsystem_cdnsystem_proto_depIdxs = nil file_pkg_rpc_cdnsystem_cdnsystem_proto_depIdxs = nil
} }

View File

@ -0,0 +1,197 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/rpc/cdnsystem/cdnsystem.proto
package cdnsystem
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
)
// Validate checks the field values on SeedRequest with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *SeedRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for Url
// no validation rules for Filter
if v, ok := interface{}(m.GetUrlMeta()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SeedRequestValidationError{
field: "UrlMeta",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// SeedRequestValidationError is the validation error returned by
// SeedRequest.Validate if the designated constraints aren't met.
type SeedRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SeedRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SeedRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SeedRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SeedRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SeedRequestValidationError) ErrorName() string { return "SeedRequestValidationError" }
// Error satisfies the builtin error interface
func (e SeedRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSeedRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SeedRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SeedRequestValidationError{}
// Validate checks the field values on PieceSeed with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PieceSeed) Validate() error {
if m == nil {
return nil
}
// no validation rules for PeerId
// no validation rules for SeederName
if v, ok := interface{}(m.GetPieceInfo()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PieceSeedValidationError{
field: "PieceInfo",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Done
// no validation rules for ContentLength
return nil
}
// PieceSeedValidationError is the validation error returned by
// PieceSeed.Validate if the designated constraints aren't met.
type PieceSeedValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PieceSeedValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PieceSeedValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PieceSeedValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PieceSeedValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PieceSeedValidationError) ErrorName() string { return "PieceSeedValidationError" }
// Error satisfies the builtin error interface
func (e PieceSeedValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPieceSeed.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PieceSeedValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PieceSeedValidationError{}

View File

@ -18,9 +18,9 @@ syntax = "proto3";
package cdnsystem; package cdnsystem;
import "internal/rpc/base/base.proto"; import "pkg/rpc/base/base.proto";
option go_package = "d7y.io/dragonfly/v2/internal/rpc/cdnsystem"; option go_package = "d7y.io/dragonfly/v2/pkg/rpc/cdnsystem";
message SeedRequest{ message SeedRequest{
string task_id = 1; string task_id = 1;

View File

@ -162,5 +162,5 @@ var _Seeder_serviceDesc = grpc.ServiceDesc{
ServerStreams: true, ServerStreams: true,
}, },
}, },
Metadata: "internal/rpc/cdnsystem/cdnsystem.proto", Metadata: "pkg/rpc/cdnsystem/cdnsystem.proto",
} }

View File

@ -15,15 +15,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.26.0
// protoc v3.15.8 // protoc v3.15.8
// source: internal/rpc/dfdaemon/dfdaemon.proto // source: pkg/rpc/dfdaemon/dfdaemon.proto
package dfdaemon package dfdaemon
import ( import (
base "d7y.io/dragonfly/v2/pkg/rpc/base" base "d7y.io/dragonfly/v2/pkg/rpc/base"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb" emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -38,10 +37,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type DownRequest struct { type DownRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -54,25 +49,26 @@ type DownRequest struct {
// pieces will be written to output path directly, // pieces will be written to output path directly,
// at the same time, dfdaemon workspace also makes soft link to the output // at the same time, dfdaemon workspace also makes soft link to the output
Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"`
// timeout duration, default 3 hour // timeout duration
Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"`
// rate limit in bytes per second // rate limit in bytes per second
Limit int64 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"` Limit float64 `protobuf:"fixed64,5,opt,name=limit,proto3" json:"limit,omitempty"`
UrlMeta *base.UrlMeta `protobuf:"bytes,6,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"` DisableBackSource bool `protobuf:"varint,6,opt,name=disable_back_source,json=disableBackSource,proto3" json:"disable_back_source,omitempty"`
UrlMeta *base.UrlMeta `protobuf:"bytes,7,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
// p2p/cdn/source // p2p/cdn/source
Pattern string `protobuf:"bytes,7,opt,name=pattern,proto3" json:"pattern,omitempty"` Pattern string `protobuf:"bytes,8,opt,name=pattern,proto3" json:"pattern,omitempty"`
// call system // call system
Callsystem string `protobuf:"bytes,8,opt,name=callsystem,proto3" json:"callsystem,omitempty"` Callsystem string `protobuf:"bytes,9,opt,name=callsystem,proto3" json:"callsystem,omitempty"`
// user id // user id
Uid int64 `protobuf:"varint,9,opt,name=uid,proto3" json:"uid,omitempty"` Uid int64 `protobuf:"varint,10,opt,name=uid,proto3" json:"uid,omitempty"`
// group id // group id
Gid int64 `protobuf:"varint,10,opt,name=gid,proto3" json:"gid,omitempty"` Gid int64 `protobuf:"varint,11,opt,name=gid,proto3" json:"gid,omitempty"`
} }
func (x *DownRequest) Reset() { func (x *DownRequest) Reset() {
*x = DownRequest{} *x = DownRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[0] mi := &file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -85,7 +81,7 @@ func (x *DownRequest) String() string {
func (*DownRequest) ProtoMessage() {} func (*DownRequest) ProtoMessage() {}
func (x *DownRequest) ProtoReflect() protoreflect.Message { func (x *DownRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[0] mi := &file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -98,7 +94,7 @@ func (x *DownRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownRequest.ProtoReflect.Descriptor instead. // Deprecated: Use DownRequest.ProtoReflect.Descriptor instead.
func (*DownRequest) Descriptor() ([]byte, []int) { func (*DownRequest) Descriptor() ([]byte, []int) {
return file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP(), []int{0} return file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP(), []int{0}
} }
func (x *DownRequest) GetUuid() string { func (x *DownRequest) GetUuid() string {
@ -129,13 +125,20 @@ func (x *DownRequest) GetTimeout() int64 {
return 0 return 0
} }
func (x *DownRequest) GetLimit() int64 { func (x *DownRequest) GetLimit() float64 {
if x != nil { if x != nil {
return x.Limit return x.Limit
} }
return 0 return 0
} }
func (x *DownRequest) GetDisableBackSource() bool {
if x != nil {
return x.DisableBackSource
}
return false
}
func (x *DownRequest) GetUrlMeta() *base.UrlMeta { func (x *DownRequest) GetUrlMeta() *base.UrlMeta {
if x != nil { if x != nil {
return x.UrlMeta return x.UrlMeta
@ -179,14 +182,13 @@ type DownResult struct {
TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
CompletedLength uint64 `protobuf:"varint,4,opt,name=completed_length,json=completedLength,proto3" json:"completed_length,omitempty"` CompletedLength uint64 `protobuf:"varint,4,opt,name=completed_length,json=completedLength,proto3" json:"completed_length,omitempty"`
// done with success or fail Done bool `protobuf:"varint,5,opt,name=done,proto3" json:"done,omitempty"`
Done bool `protobuf:"varint,5,opt,name=done,proto3" json:"done,omitempty"`
} }
func (x *DownResult) Reset() { func (x *DownResult) Reset() {
*x = DownResult{} *x = DownResult{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[1] mi := &file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -199,7 +201,7 @@ func (x *DownResult) String() string {
func (*DownResult) ProtoMessage() {} func (*DownResult) ProtoMessage() {}
func (x *DownResult) ProtoReflect() protoreflect.Message { func (x *DownResult) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[1] mi := &file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -212,7 +214,7 @@ func (x *DownResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use DownResult.ProtoReflect.Descriptor instead. // Deprecated: Use DownResult.ProtoReflect.Descriptor instead.
func (*DownResult) Descriptor() ([]byte, []int) { func (*DownResult) Descriptor() ([]byte, []int) {
return file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP(), []int{1} return file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP(), []int{1}
} }
func (x *DownResult) GetTaskId() string { func (x *DownResult) GetTaskId() string {
@ -243,72 +245,74 @@ func (x *DownResult) GetDone() bool {
return false return false
} }
var File_internal_rpc_dfdaemon_dfdaemon_proto protoreflect.FileDescriptor var File_pkg_rpc_dfdaemon_dfdaemon_proto protoreflect.FileDescriptor
var file_internal_rpc_dfdaemon_dfdaemon_proto_rawDesc = []byte{ var file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDesc = []byte{
0x0a, 0x24, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x0a, 0x1f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d,
0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f, 0x6e, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x6f, 0x12, 0x08, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x1a, 0x17, 0x70, 0x6b, 0x67,
0x1a, 0x1c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70,
0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x02, 0x0a, 0x0b, 0x6f, 0x22, 0xb3, 0x02, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01,
0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75,
0x6c, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12,
0x09, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d,
0x6f, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12,
0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x2e, 0x0a, 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x5f,
0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x64, 0x69,
0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12,
0x65, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x07, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61,
0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x18, 0x08, 0x20, 0x01, 0x28, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x74,
0x09, 0x52, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x74, 0x65, 0x72, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x74, 0x74,
0x03, 0x75, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x65, 0x72, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x79, 0x73, 0x74, 0x65,
0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x79, 0x73,
0x64, 0x22, 0x7d, 0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03,
0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x0b, 0x20, 0x01,
0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64, 0x22, 0x7d, 0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x52,
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64,
0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17,
0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x70, 0x6c,
0x64, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28,
0x32, 0xbe, 0x01, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x44, 0x04, 0x52, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x6e, 0x67,
0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x15, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08,
0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x32, 0xbe, 0x01, 0x0a, 0x06, 0x44, 0x61, 0x65, 0x6d, 0x6f,
0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x08, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x15, 0x2e,
0x73, 0x75, 0x6c, 0x74, 0x30, 0x01, 0x12, 0x3a, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x69, 0x65, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71,
0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x16, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x2e,
0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x44, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x30, 0x01, 0x12, 0x3a, 0x0a, 0x0d,
0x11, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x47, 0x65, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x73, 0x12, 0x16, 0x2e,
0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65,
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x63, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x43, 0x68, 0x65, 0x63,
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x6b, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x79, 0x42, 0x2b, 0x5a, 0x29, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x26, 0x5a, 0x24, 0x64, 0x37, 0x79, 0x2e, 0x69,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x6f, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x70,
0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x66, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescOnce sync.Once file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescOnce sync.Once
file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescData = file_internal_rpc_dfdaemon_dfdaemon_proto_rawDesc file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescData = file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDesc
) )
func file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP() []byte { func file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescGZIP() []byte {
file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescOnce.Do(func() { file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescOnce.Do(func() {
file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescData) file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescData)
}) })
return file_internal_rpc_dfdaemon_dfdaemon_proto_rawDescData return file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDescData
} }
var file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_internal_rpc_dfdaemon_dfdaemon_proto_goTypes = []interface{}{ var file_pkg_rpc_dfdaemon_dfdaemon_proto_goTypes = []interface{}{
(*DownRequest)(nil), // 0: dfdaemon.DownRequest (*DownRequest)(nil), // 0: dfdaemon.DownRequest
(*DownResult)(nil), // 1: dfdaemon.DownResult (*DownResult)(nil), // 1: dfdaemon.DownResult
(*base.UrlMeta)(nil), // 2: base.UrlMeta (*base.UrlMeta)(nil), // 2: base.UrlMeta
@ -316,7 +320,7 @@ var file_internal_rpc_dfdaemon_dfdaemon_proto_goTypes = []interface{}{
(*emptypb.Empty)(nil), // 4: google.protobuf.Empty (*emptypb.Empty)(nil), // 4: google.protobuf.Empty
(*base.PiecePacket)(nil), // 5: base.PiecePacket (*base.PiecePacket)(nil), // 5: base.PiecePacket
} }
var file_internal_rpc_dfdaemon_dfdaemon_proto_depIdxs = []int32{ var file_pkg_rpc_dfdaemon_dfdaemon_proto_depIdxs = []int32{
2, // 0: dfdaemon.DownRequest.url_meta:type_name -> base.UrlMeta 2, // 0: dfdaemon.DownRequest.url_meta:type_name -> base.UrlMeta
0, // 1: dfdaemon.Daemon.Download:input_type -> dfdaemon.DownRequest 0, // 1: dfdaemon.Daemon.Download:input_type -> dfdaemon.DownRequest
3, // 2: dfdaemon.Daemon.GetPieceTasks:input_type -> base.PieceTaskRequest 3, // 2: dfdaemon.Daemon.GetPieceTasks:input_type -> base.PieceTaskRequest
@ -331,13 +335,13 @@ var file_internal_rpc_dfdaemon_dfdaemon_proto_depIdxs = []int32{
0, // [0:1] is the sub-list for field type_name 0, // [0:1] is the sub-list for field type_name
} }
func init() { file_internal_rpc_dfdaemon_dfdaemon_proto_init() } func init() { file_pkg_rpc_dfdaemon_dfdaemon_proto_init() }
func file_internal_rpc_dfdaemon_dfdaemon_proto_init() { func file_pkg_rpc_dfdaemon_dfdaemon_proto_init() {
if File_internal_rpc_dfdaemon_dfdaemon_proto != nil { if File_pkg_rpc_dfdaemon_dfdaemon_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownRequest); i { switch v := v.(*DownRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -349,7 +353,7 @@ func file_internal_rpc_dfdaemon_dfdaemon_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DownResult); i { switch v := v.(*DownResult); i {
case 0: case 0:
return &v.state return &v.state
@ -366,18 +370,18 @@ func file_internal_rpc_dfdaemon_dfdaemon_proto_init() {
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_rpc_dfdaemon_dfdaemon_proto_rawDesc, RawDescriptor: file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 2, NumMessages: 2,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
GoTypes: file_internal_rpc_dfdaemon_dfdaemon_proto_goTypes, GoTypes: file_pkg_rpc_dfdaemon_dfdaemon_proto_goTypes,
DependencyIndexes: file_internal_rpc_dfdaemon_dfdaemon_proto_depIdxs, DependencyIndexes: file_pkg_rpc_dfdaemon_dfdaemon_proto_depIdxs,
MessageInfos: file_internal_rpc_dfdaemon_dfdaemon_proto_msgTypes, MessageInfos: file_pkg_rpc_dfdaemon_dfdaemon_proto_msgTypes,
}.Build() }.Build()
File_internal_rpc_dfdaemon_dfdaemon_proto = out.File File_pkg_rpc_dfdaemon_dfdaemon_proto = out.File
file_internal_rpc_dfdaemon_dfdaemon_proto_rawDesc = nil file_pkg_rpc_dfdaemon_dfdaemon_proto_rawDesc = nil
file_internal_rpc_dfdaemon_dfdaemon_proto_goTypes = nil file_pkg_rpc_dfdaemon_dfdaemon_proto_goTypes = nil
file_internal_rpc_dfdaemon_dfdaemon_proto_depIdxs = nil file_pkg_rpc_dfdaemon_dfdaemon_proto_depIdxs = nil
} }

View File

@ -0,0 +1,201 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/rpc/dfdaemon/dfdaemon.proto
package dfdaemon
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
)
// Validate checks the field values on DownRequest with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *DownRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Uuid
// no validation rules for Url
// no validation rules for Output
// no validation rules for Timeout
// no validation rules for Limit
// no validation rules for DisableBackSource
if v, ok := interface{}(m.GetUrlMeta()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return DownRequestValidationError{
field: "UrlMeta",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for Pattern
// no validation rules for Callsystem
// no validation rules for Uid
// no validation rules for Gid
return nil
}
// DownRequestValidationError is the validation error returned by
// DownRequest.Validate if the designated constraints aren't met.
type DownRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownRequestValidationError) ErrorName() string { return "DownRequestValidationError" }
// Error satisfies the builtin error interface
func (e DownRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDownRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownRequestValidationError{}
// Validate checks the field values on DownResult with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *DownResult) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for PeerId
// no validation rules for CompletedLength
// no validation rules for Done
return nil
}
// DownResultValidationError is the validation error returned by
// DownResult.Validate if the designated constraints aren't met.
type DownResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e DownResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e DownResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e DownResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e DownResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e DownResultValidationError) ErrorName() string { return "DownResultValidationError" }
// Error satisfies the builtin error interface
func (e DownResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sDownResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = DownResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = DownResultValidationError{}

View File

@ -18,10 +18,10 @@ syntax = "proto3";
package dfdaemon; package dfdaemon;
import "internal/rpc/base/base.proto"; import "pkg/rpc/base/base.proto";
import "google/protobuf/empty.proto"; import "google/protobuf/empty.proto";
option go_package = "d7y.io/dragonfly/v2/internal/rpc/dfdaemon"; option go_package = "d7y.io/dragonfly/v2/pkg/rpc/dfdaemon";
message DownRequest{ message DownRequest{
// identify one downloading, the framework will fill it automatically // identify one downloading, the framework will fill it automatically
@ -31,26 +31,26 @@ message DownRequest{
// pieces will be written to output path directly, // pieces will be written to output path directly,
// at the same time, dfdaemon workspace also makes soft link to the output // at the same time, dfdaemon workspace also makes soft link to the output
string output = 3; string output = 3;
// timeout duration, default 3 hour // timeout duration
int64 timeout = 4; int64 timeout = 4;
// rate limit in bytes per second // rate limit in bytes per second
int64 limit = 5; double limit = 5;
base.UrlMeta url_meta = 6; bool disable_back_source = 6;
base.UrlMeta url_meta = 7;
// p2p/cdn/source // p2p/cdn/source
string pattern = 7; string pattern = 8;
// call system // call system
string callsystem = 8; string callsystem = 9;
// user id // user id
int64 uid = 9; int64 uid = 10;
// group id // group id
int64 gid = 10; int64 gid = 11;
} }
message DownResult{ message DownResult{
string task_id = 2; string task_id = 2;
string peer_id = 3; string peer_id = 3;
uint64 completed_length = 4; uint64 completed_length = 4;
// done with success or fail
bool done = 5; bool done = 5;
} }
@ -62,6 +62,4 @@ service Daemon{
rpc GetPieceTasks(base.PieceTaskRequest)returns(base.PiecePacket); rpc GetPieceTasks(base.PieceTaskRequest)returns(base.PiecePacket);
// check daemon health // check daemon health
rpc CheckHealth(google.protobuf.Empty)returns(google.protobuf.Empty); rpc CheckHealth(google.protobuf.Empty)returns(google.protobuf.Empty);
} }

View File

@ -201,5 +201,5 @@ var _Daemon_serviceDesc = grpc.ServiceDesc{
ServerStreams: true, ServerStreams: true,
}, },
}, },
Metadata: "internal/rpc/dfdaemon/dfdaemon.proto", Metadata: "pkg/rpc/dfdaemon/dfdaemon.proto",
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
// Code generated by protoc-gen-validate. DO NOT EDIT. // Code generated by protoc-gen-validate. DO NOT EDIT.
// source: internal/rpc/manager/manager.proto // source: pkg/rpc/manager/manager.proto
package manager package manager

View File

@ -21,7 +21,7 @@ package manager;
import "google/protobuf/empty.proto"; import "google/protobuf/empty.proto";
import "validate/validate.proto"; import "validate/validate.proto";
option go_package = "d7y.io/dragonfly/v2/internal/rpc/manager"; option go_package = "d7y.io/dragonfly/v2/pkg/rpc/manager";
enum SourceType { enum SourceType {
SCHEDULER_SOURCE = 0; SCHEDULER_SOURCE = 0;
@ -65,27 +65,27 @@ message GetCDNRequest {
message CreateCDNRequest { message CreateCDNRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
string host_name = 2 [(validate.rules).string.hostname = true]; string host_name = 2 [(validate.rules).string.hostname = true];
string idc = 4 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string idc = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string location = 5 [(validate.rules).string = { max_len: 1024, ignore_empty: true }]; string location = 5 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
string ip = 6 [(validate.rules).string.ip = true]; string ip = 6 [(validate.rules).string.ip = true];
int32 port = 7 [(validate.rules).int32 = { gte: 1024, lt: 65535 }]; int32 port = 7 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
int32 download_port = 8 [(validate.rules).int32 = { gte: 1024, lt: 65535 }]; int32 download_port = 8 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
} }
message UpdateCDNRequest { message UpdateCDNRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
string host_name = 2 [(validate.rules).string.hostname = true]; string host_name = 2 [(validate.rules).string.hostname = true];
string idc = 3 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string idc = 3 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string location = 4 [(validate.rules).string = { max_len: 1024, ignore_empty: true }]; string location = 4 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
string ip = 5 [(validate.rules).string = { ip: true, ignore_empty: true }]; string ip = 5 [(validate.rules).string = {ip: true, ignore_empty: true}];
int32 port = 6 [(validate.rules).int32 = { gte: 1024, lt: 65535, ignore_empty: true }]; int32 port = 6 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
int32 download_port = 7 [(validate.rules).int32 = { gte: 1024, lt: 65535, ignore_empty: true }]; int32 download_port = 7 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
} }
message AddCDNToCDNClusterRequest { message AddCDNToCDNClusterRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
uint64 cdn_id = 2 [(validate.rules).uint64 = { ignore_empty: true }]; uint64 cdn_id = 2 [(validate.rules).uint64 = {ignore_empty: true}];
uint64 cdn_cluster_id = 3 [(validate.rules).uint64 = { ignore_empty: true }]; uint64 cdn_cluster_id = 3 [(validate.rules).uint64 = {ignore_empty: true}];
} }
message SchedulerCluster { message SchedulerCluster {
@ -119,29 +119,29 @@ message GetSchedulerRequest {
message CreateSchedulerRequest { message CreateSchedulerRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
string host_name = 2 [(validate.rules).string.hostname = true]; string host_name = 2 [(validate.rules).string.hostname = true];
string vips = 4 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string vips = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string idc = 5 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string idc = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string location = 6 [(validate.rules).string = { max_len: 1024, ignore_empty: true }]; string location = 6 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
bytes net_config = 7 [(validate.rules).bytes = { min_len: 1, ignore_empty: true }]; bytes net_config = 7 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
string ip = 8 [(validate.rules).string.ip = true]; string ip = 8 [(validate.rules).string.ip = true];
int32 port = 9 [(validate.rules).int32 = { gte: 1024, lt: 65535 }]; int32 port = 9 [(validate.rules).int32 = {gte: 1024, lt: 65535}];
} }
message UpdateSchedulerRequest { message UpdateSchedulerRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
string host_name = 2 [(validate.rules).string.hostname = true]; string host_name = 2 [(validate.rules).string.hostname = true];
string vips = 4 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string vips = 4 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string idc = 5 [(validate.rules).string = { min_len: 1, max_len: 1024, ignore_empty: true }]; string idc = 5 [(validate.rules).string = {min_len: 1, max_len: 1024, ignore_empty: true}];
string location = 6 [(validate.rules).string = { max_len: 1024, ignore_empty: true }]; string location = 6 [(validate.rules).string = {max_len: 1024, ignore_empty: true}];
bytes net_config = 7 [(validate.rules).bytes = { min_len: 1, ignore_empty: true }]; bytes net_config = 7 [(validate.rules).bytes = {min_len: 1, ignore_empty: true}];
string ip = 8 [(validate.rules).string = { ip: true, ignore_empty: true }]; string ip = 8 [(validate.rules).string = {ip: true, ignore_empty: true}];
int32 port = 9 [(validate.rules).int32 = { gte: 1024, lt: 65535, ignore_empty: true }]; int32 port = 9 [(validate.rules).int32 = {gte: 1024, lt: 65535, ignore_empty: true}];
} }
message AddSchedulerClusterToSchedulerClusterRequest { message AddSchedulerClusterToSchedulerClusterRequest {
SourceType source_type = 1 [(validate.rules).enum.defined_only = true]; SourceType source_type = 1 [(validate.rules).enum.defined_only = true];
uint64 scheduler_id = 2 [(validate.rules).uint64 = { ignore_empty: true }]; uint64 scheduler_id = 2 [(validate.rules).uint64 = {ignore_empty: true}];
uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = { ignore_empty: true }]; uint64 scheduler_cluster_id = 3 [(validate.rules).uint64 = {ignore_empty: true}];
} }
message ListSchedulersRequest { message ListSchedulersRequest {
@ -152,7 +152,7 @@ message ListSchedulersRequest {
} }
message ListSchedulersResponse { message ListSchedulersResponse {
repeated Scheduler schedulers = 1; repeated Scheduler schedulers = 1;
} }
message KeepAliveRequest { message KeepAliveRequest {

View File

@ -12,7 +12,6 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7 const _ = grpc.SupportPackageIsVersion7
// ManagerClient is the client API for Manager service. // ManagerClient is the client API for Manager service.
@ -131,7 +130,7 @@ func (c *managerClient) ListSchedulers(ctx context.Context, in *ListSchedulersRe
} }
func (c *managerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (Manager_KeepAliveClient, error) { func (c *managerClient) KeepAlive(ctx context.Context, opts ...grpc.CallOption) (Manager_KeepAliveClient, error) {
stream, err := c.cc.NewStream(ctx, &Manager_ServiceDesc.Streams[0], "/manager.Manager/KeepAlive", opts...) stream, err := c.cc.NewStream(ctx, &_Manager_serviceDesc.Streams[0], "/manager.Manager/KeepAlive", opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -235,7 +234,7 @@ type UnsafeManagerServer interface {
} }
func RegisterManagerServer(s grpc.ServiceRegistrar, srv ManagerServer) { func RegisterManagerServer(s grpc.ServiceRegistrar, srv ManagerServer) {
s.RegisterService(&Manager_ServiceDesc, srv) s.RegisterService(&_Manager_serviceDesc, srv)
} }
func _Manager_GetCDN_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Manager_GetCDN_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
@ -426,10 +425,7 @@ func (x *managerKeepAliveServer) Recv() (*KeepAliveRequest, error) {
return m, nil return m, nil
} }
// Manager_ServiceDesc is the grpc.ServiceDesc for Manager service. var _Manager_serviceDesc = grpc.ServiceDesc{
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Manager_ServiceDesc = grpc.ServiceDesc{
ServiceName: "manager.Manager", ServiceName: "manager.Manager",
HandlerType: (*ManagerServer)(nil), HandlerType: (*ManagerServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
@ -477,5 +473,5 @@ var Manager_ServiceDesc = grpc.ServiceDesc{
ClientStreams: true, ClientStreams: true,
}, },
}, },
Metadata: "internal/rpc/manager/manager.proto", Metadata: "pkg/rpc/manager/manager.proto",
} }

View File

@ -15,15 +15,14 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.25.0 // protoc-gen-go v1.26.0
// protoc v3.15.8 // protoc v3.15.8
// source: internal/rpc/scheduler/scheduler.proto // source: pkg/rpc/scheduler/scheduler.proto
package scheduler package scheduler
import ( import (
base "d7y.io/dragonfly/v2/pkg/rpc/base" base "d7y.io/dragonfly/v2/pkg/rpc/base"
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb" emptypb "google.golang.org/protobuf/types/known/emptypb"
@ -38,10 +37,6 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type PeerTaskRequest struct { type PeerTaskRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -69,7 +64,7 @@ type PeerTaskRequest struct {
func (x *PeerTaskRequest) Reset() { func (x *PeerTaskRequest) Reset() {
*x = PeerTaskRequest{} *x = PeerTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[0] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -82,7 +77,7 @@ func (x *PeerTaskRequest) String() string {
func (*PeerTaskRequest) ProtoMessage() {} func (*PeerTaskRequest) ProtoMessage() {}
func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message { func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[0] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -95,7 +90,7 @@ func (x *PeerTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use PeerTaskRequest.ProtoReflect.Descriptor instead.
func (*PeerTaskRequest) Descriptor() ([]byte, []int) { func (*PeerTaskRequest) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{0} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{0}
} }
func (x *PeerTaskRequest) GetUrl() string { func (x *PeerTaskRequest) GetUrl() string {
@ -174,7 +169,7 @@ type RegisterResult struct {
func (x *RegisterResult) Reset() { func (x *RegisterResult) Reset() {
*x = RegisterResult{} *x = RegisterResult{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[1] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -187,7 +182,7 @@ func (x *RegisterResult) String() string {
func (*RegisterResult) ProtoMessage() {} func (*RegisterResult) ProtoMessage() {}
func (x *RegisterResult) ProtoReflect() protoreflect.Message { func (x *RegisterResult) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[1] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -200,7 +195,7 @@ func (x *RegisterResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use RegisterResult.ProtoReflect.Descriptor instead. // Deprecated: Use RegisterResult.ProtoReflect.Descriptor instead.
func (*RegisterResult) Descriptor() ([]byte, []int) { func (*RegisterResult) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{1} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{1}
} }
func (x *RegisterResult) GetTaskId() string { func (x *RegisterResult) GetTaskId() string {
@ -272,7 +267,7 @@ type SinglePiece struct {
func (x *SinglePiece) Reset() { func (x *SinglePiece) Reset() {
*x = SinglePiece{} *x = SinglePiece{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[2] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -285,7 +280,7 @@ func (x *SinglePiece) String() string {
func (*SinglePiece) ProtoMessage() {} func (*SinglePiece) ProtoMessage() {}
func (x *SinglePiece) ProtoReflect() protoreflect.Message { func (x *SinglePiece) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[2] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -298,7 +293,7 @@ func (x *SinglePiece) ProtoReflect() protoreflect.Message {
// Deprecated: Use SinglePiece.ProtoReflect.Descriptor instead. // Deprecated: Use SinglePiece.ProtoReflect.Descriptor instead.
func (*SinglePiece) Descriptor() ([]byte, []int) { func (*SinglePiece) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{2} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{2}
} }
func (x *SinglePiece) GetDstPid() string { func (x *SinglePiece) GetDstPid() string {
@ -350,7 +345,7 @@ type PeerHost struct {
func (x *PeerHost) Reset() { func (x *PeerHost) Reset() {
*x = PeerHost{} *x = PeerHost{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[3] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -363,7 +358,7 @@ func (x *PeerHost) String() string {
func (*PeerHost) ProtoMessage() {} func (*PeerHost) ProtoMessage() {}
func (x *PeerHost) ProtoReflect() protoreflect.Message { func (x *PeerHost) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[3] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -376,7 +371,7 @@ func (x *PeerHost) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerHost.ProtoReflect.Descriptor instead. // Deprecated: Use PeerHost.ProtoReflect.Descriptor instead.
func (*PeerHost) Descriptor() ([]byte, []int) { func (*PeerHost) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{3} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{3}
} }
func (x *PeerHost) GetUuid() string { func (x *PeerHost) GetUuid() string {
@ -472,7 +467,7 @@ type PieceResult struct {
func (x *PieceResult) Reset() { func (x *PieceResult) Reset() {
*x = PieceResult{} *x = PieceResult{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[4] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -485,7 +480,7 @@ func (x *PieceResult) String() string {
func (*PieceResult) ProtoMessage() {} func (*PieceResult) ProtoMessage() {}
func (x *PieceResult) ProtoReflect() protoreflect.Message { func (x *PieceResult) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[4] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -498,7 +493,7 @@ func (x *PieceResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use PieceResult.ProtoReflect.Descriptor instead. // Deprecated: Use PieceResult.ProtoReflect.Descriptor instead.
func (*PieceResult) Descriptor() ([]byte, []int) { func (*PieceResult) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{4} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{4}
} }
func (x *PieceResult) GetTaskId() string { func (x *PieceResult) GetTaskId() string {
@ -590,7 +585,7 @@ type PeerPacket struct {
func (x *PeerPacket) Reset() { func (x *PeerPacket) Reset() {
*x = PeerPacket{} *x = PeerPacket{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[5] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -603,7 +598,7 @@ func (x *PeerPacket) String() string {
func (*PeerPacket) ProtoMessage() {} func (*PeerPacket) ProtoMessage() {}
func (x *PeerPacket) ProtoReflect() protoreflect.Message { func (x *PeerPacket) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[5] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -616,7 +611,7 @@ func (x *PeerPacket) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerPacket.ProtoReflect.Descriptor instead. // Deprecated: Use PeerPacket.ProtoReflect.Descriptor instead.
func (*PeerPacket) Descriptor() ([]byte, []int) { func (*PeerPacket) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5}
} }
func (x *PeerPacket) GetTaskId() string { func (x *PeerPacket) GetTaskId() string {
@ -687,7 +682,7 @@ type PeerResult struct {
func (x *PeerResult) Reset() { func (x *PeerResult) Reset() {
*x = PeerResult{} *x = PeerResult{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[6] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -700,7 +695,7 @@ func (x *PeerResult) String() string {
func (*PeerResult) ProtoMessage() {} func (*PeerResult) ProtoMessage() {}
func (x *PeerResult) ProtoReflect() protoreflect.Message { func (x *PeerResult) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[6] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -713,7 +708,7 @@ func (x *PeerResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerResult.ProtoReflect.Descriptor instead. // Deprecated: Use PeerResult.ProtoReflect.Descriptor instead.
func (*PeerResult) Descriptor() ([]byte, []int) { func (*PeerResult) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{6} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{6}
} }
func (x *PeerResult) GetTaskId() string { func (x *PeerResult) GetTaskId() string {
@ -805,7 +800,7 @@ type PeerTarget struct {
func (x *PeerTarget) Reset() { func (x *PeerTarget) Reset() {
*x = PeerTarget{} *x = PeerTarget{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[7] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -818,7 +813,7 @@ func (x *PeerTarget) String() string {
func (*PeerTarget) ProtoMessage() {} func (*PeerTarget) ProtoMessage() {}
func (x *PeerTarget) ProtoReflect() protoreflect.Message { func (x *PeerTarget) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[7] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -831,7 +826,7 @@ func (x *PeerTarget) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerTarget.ProtoReflect.Descriptor instead. // Deprecated: Use PeerTarget.ProtoReflect.Descriptor instead.
func (*PeerTarget) Descriptor() ([]byte, []int) { func (*PeerTarget) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{7} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{7}
} }
func (x *PeerTarget) GetTaskId() string { func (x *PeerTarget) GetTaskId() string {
@ -864,7 +859,7 @@ type PeerPacket_DestPeer struct {
func (x *PeerPacket_DestPeer) Reset() { func (x *PeerPacket_DestPeer) Reset() {
*x = PeerPacket_DestPeer{} *x = PeerPacket_DestPeer{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[8] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -877,7 +872,7 @@ func (x *PeerPacket_DestPeer) String() string {
func (*PeerPacket_DestPeer) ProtoMessage() {} func (*PeerPacket_DestPeer) ProtoMessage() {}
func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message { func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message {
mi := &file_internal_rpc_scheduler_scheduler_proto_msgTypes[8] mi := &file_pkg_rpc_scheduler_scheduler_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -890,7 +885,7 @@ func (x *PeerPacket_DestPeer) ProtoReflect() protoreflect.Message {
// Deprecated: Use PeerPacket_DestPeer.ProtoReflect.Descriptor instead. // Deprecated: Use PeerPacket_DestPeer.ProtoReflect.Descriptor instead.
func (*PeerPacket_DestPeer) Descriptor() ([]byte, []int) { func (*PeerPacket_DestPeer) Descriptor() ([]byte, []int) {
return file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5, 0} return file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP(), []int{5, 0}
} }
func (x *PeerPacket_DestPeer) GetIp() string { func (x *PeerPacket_DestPeer) GetIp() string {
@ -914,172 +909,171 @@ func (x *PeerPacket_DestPeer) GetPeerId() string {
return "" return ""
} }
var File_internal_rpc_scheduler_scheduler_proto protoreflect.FileDescriptor var File_pkg_rpc_scheduler_scheduler_proto protoreflect.FileDescriptor
var file_internal_rpc_scheduler_scheduler_proto_rawDesc = []byte{ var file_pkg_rpc_scheduler_scheduler_proto_rawDesc = []byte{
0x0a, 0x26, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x0a, 0x21, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x1a, 0x17,
0x6c, 0x65, 0x72, 0x1a, 0x1c, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73,
0x63, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70,
0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x02, 0x0a, 0x0f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73,
0x02, 0x0a, 0x0f, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18,
0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69,
0x03, 0x75, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x62, 0x69, 0x7a, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x28, 0x09, 0x52, 0x05, 0x62, 0x69, 0x7a, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c,
0x7a, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x75, 0x72, 0x6c, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61,
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x73, 0x65, 0x2e, 0x55, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d,
0x4d, 0x65, 0x74, 0x61, 0x52, 0x07, 0x75, 0x72, 0x6c, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x65, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05,
0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x09,
0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x68, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x6f, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x13, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x08, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x08, 0x70, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x2b,
0x70, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28,
0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61,
0x73, 0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x64, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69,
0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x73, 0x5f, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28,
0x61, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xcd,
0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xcd, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x0a, 0x73, 0x69,
0x73, 0x6b, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x7a, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52,
0x53, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x52, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x53, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x73, 0x69,
0x63, 0x6f, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
0x69, 0x65, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x32, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x69, 0x6e,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x67,
0x63, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x70, 0x69, 0x65, 0x63, 0x65,
0x65, 0x12, 0x25, 0x0a, 0x0d, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00,
0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x52, 0x0c, 0x70, 0x69, 0x65, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0e,
0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x64, 0x69, 0x72, 0x65, 0x0a, 0x0c, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x22, 0x71,
0x63, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x22, 0x71, 0x0a, 0x0b, 0x53, 0x69, 0x6e, 0x67, 0x0a, 0x0b, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x17, 0x0a,
0x6c, 0x65, 0x50, 0x69, 0x65, 0x63, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06,
0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64,
0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64,
0x28, 0x09, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2e, 0x0a, 0x0a, 0x70, 0x72, 0x12, 0x2e, 0x0a, 0x0a, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18,
0x69, 0x65, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65,
0x0f, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66,
0x52, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x08, 0x6f, 0x22, 0xfd, 0x01, 0x0a, 0x08, 0x50, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x12,
0x50, 0x65, 0x65, 0x72, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03,
0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a,
0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x09, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
0x70, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x08, 0x64, 0x6f, 0x77, 0x6e, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f,
0x50, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x6f, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72,
0x65, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03,
0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x69, 0x64, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x21,
0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x5f, 0x0a, 0x0c, 0x6e, 0x65, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x18, 0x09,
0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67,
0x6e, 0x65, 0x74, 0x54, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x22, 0xbd, 0x02, 0x0a, 0x0b, 0x79, 0x22, 0xbd, 0x02, 0x0a, 0x0b, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72,
0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x50, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03,
0x07, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09,
0x64, 0x73, 0x74, 0x50, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x70, 0x69, 0x65, 0x63, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x08, 0x70, 0x69, 0x65, 0x63, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x65, 0x67,
0x4e, 0x75, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x69, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x62,
0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x65, 0x67, 0x69, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f,
0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54,
0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x07,
0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a,
0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61,
0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a,
0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x09, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b,
0x6c, 0x6f, 0x61, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x73, 0x32, 0x0e, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64,
0x65, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69,
0x4c, 0x6f, 0x61, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01,
0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, 0x28, 0x05, 0x52, 0x0d, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e,
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd3, 0x02, 0x0a, 0x0a, 0x74, 0x22, 0xd3, 0x02, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63,
0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x5f, 0x63,
0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x61,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x61, 0x6c, 0x6c, 0x65, 0x6c, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x69,
0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x6e, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73,
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63,
0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61,
0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x69, 0x6e, 0x50, 0x65, 0x65, 0x72, 0x69, 0x6e, 0x50, 0x65, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0b, 0x73, 0x74, 0x65, 0x61, 0x6c, 0x5f,
0x12, 0x3f, 0x0a, 0x0b, 0x73, 0x74, 0x65, 0x61, 0x6c, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63,
0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65,
0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73,
0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x0a, 0x73, 0x74, 0x65, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72,
0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64,
0x65, 0x1a, 0x4e, 0x0a, 0x08, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x19, 0x0a,
0x08, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72,
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49,
0x64, 0x22, 0xb1, 0x02, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72,
0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x73, 0x72, 0x63, 0x49, 0x70, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x65, 0x63,
0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x69, 0x64, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a,
0x07, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x18,
0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73,
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20,
0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52,
0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3e, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x72,
0x67, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07,
0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70,
0x65, 0x65, 0x72, 0x49, 0x64, 0x32, 0x9d, 0x02, 0x0a, 0x09, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x50,
0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75,
0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x46,
0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e,
0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x15, 0x2e, 0x73, 0x63,
0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b,
0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x0a, 0x73, 0x74, 0x65,
0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x61, 0x6c, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64,
0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x1a, 0x4e, 0x0a, 0x08, 0x44, 0x65, 0x73, 0x74, 0x50,
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x65, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x02, 0x69, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18,
0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x16, 0x2e, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x70, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x17,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x2c, 0x5a, 0x2a, 0x64, 0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22, 0xb1, 0x02, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72,
0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69,
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12,
0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x72, 0x63, 0x5f,
0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x72, 0x63, 0x49, 0x70, 0x12,
0x27, 0x0a, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x6f, 0x6d, 0x61,
0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69,
0x74, 0x79, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x63, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72,
0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x25, 0x0a, 0x0e,
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07,
0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x6e,
0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x18, 0x08,
0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x73,
0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01,
0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x04, 0x63,
0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x62, 0x61, 0x73, 0x65,
0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3e, 0x0a, 0x0a, 0x50,
0x65, 0x65, 0x72, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x61, 0x73,
0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b,
0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x32, 0x9d, 0x02, 0x0a, 0x09,
0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x10, 0x52, 0x65, 0x67,
0x69, 0x73, 0x74, 0x65, 0x72, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x2e,
0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61,
0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x73, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x69,
0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x16, 0x2e, 0x73, 0x63, 0x68, 0x65,
0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x69, 0x65, 0x63, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c,
0x74, 0x1a, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65,
0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x28, 0x01, 0x30, 0x01, 0x12, 0x41, 0x0a, 0x10,
0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x12, 0x15, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65,
0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12,
0x3a, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x15, 0x2e, 0x73,
0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x54, 0x61, 0x72,
0x67, 0x65, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x27, 0x5a, 0x25, 0x64,
0x37, 0x79, 0x2e, 0x69, 0x6f, 0x2f, 0x64, 0x72, 0x61, 0x67, 0x6f, 0x6e, 0x66, 0x6c, 0x79, 0x2f,
0x76, 0x32, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x64,
0x75, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
file_internal_rpc_scheduler_scheduler_proto_rawDescOnce sync.Once file_pkg_rpc_scheduler_scheduler_proto_rawDescOnce sync.Once
file_internal_rpc_scheduler_scheduler_proto_rawDescData = file_internal_rpc_scheduler_scheduler_proto_rawDesc file_pkg_rpc_scheduler_scheduler_proto_rawDescData = file_pkg_rpc_scheduler_scheduler_proto_rawDesc
) )
func file_internal_rpc_scheduler_scheduler_proto_rawDescGZIP() []byte { func file_pkg_rpc_scheduler_scheduler_proto_rawDescGZIP() []byte {
file_internal_rpc_scheduler_scheduler_proto_rawDescOnce.Do(func() { file_pkg_rpc_scheduler_scheduler_proto_rawDescOnce.Do(func() {
file_internal_rpc_scheduler_scheduler_proto_rawDescData = protoimpl.X.CompressGZIP(file_internal_rpc_scheduler_scheduler_proto_rawDescData) file_pkg_rpc_scheduler_scheduler_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_rpc_scheduler_scheduler_proto_rawDescData)
}) })
return file_internal_rpc_scheduler_scheduler_proto_rawDescData return file_pkg_rpc_scheduler_scheduler_proto_rawDescData
} }
var file_internal_rpc_scheduler_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_pkg_rpc_scheduler_scheduler_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_internal_rpc_scheduler_scheduler_proto_goTypes = []interface{}{ var file_pkg_rpc_scheduler_scheduler_proto_goTypes = []interface{}{
(*PeerTaskRequest)(nil), // 0: scheduler.PeerTaskRequest (*PeerTaskRequest)(nil), // 0: scheduler.PeerTaskRequest
(*RegisterResult)(nil), // 1: scheduler.RegisterResult (*RegisterResult)(nil), // 1: scheduler.RegisterResult
(*SinglePiece)(nil), // 2: scheduler.SinglePiece (*SinglePiece)(nil), // 2: scheduler.SinglePiece
@ -1096,7 +1090,7 @@ var file_internal_rpc_scheduler_scheduler_proto_goTypes = []interface{}{
(base.Code)(0), // 13: base.Code (base.Code)(0), // 13: base.Code
(*emptypb.Empty)(nil), // 14: google.protobuf.Empty (*emptypb.Empty)(nil), // 14: google.protobuf.Empty
} }
var file_internal_rpc_scheduler_scheduler_proto_depIdxs = []int32{ var file_pkg_rpc_scheduler_scheduler_proto_depIdxs = []int32{
9, // 0: scheduler.PeerTaskRequest.url_meta:type_name -> base.UrlMeta 9, // 0: scheduler.PeerTaskRequest.url_meta:type_name -> base.UrlMeta
3, // 1: scheduler.PeerTaskRequest.peer_host:type_name -> scheduler.PeerHost 3, // 1: scheduler.PeerTaskRequest.peer_host:type_name -> scheduler.PeerHost
10, // 2: scheduler.PeerTaskRequest.host_load:type_name -> base.HostLoad 10, // 2: scheduler.PeerTaskRequest.host_load:type_name -> base.HostLoad
@ -1124,13 +1118,13 @@ var file_internal_rpc_scheduler_scheduler_proto_depIdxs = []int32{
0, // [0:12] is the sub-list for field type_name 0, // [0:12] is the sub-list for field type_name
} }
func init() { file_internal_rpc_scheduler_scheduler_proto_init() } func init() { file_pkg_rpc_scheduler_scheduler_proto_init() }
func file_internal_rpc_scheduler_scheduler_proto_init() { func file_pkg_rpc_scheduler_scheduler_proto_init() {
if File_internal_rpc_scheduler_scheduler_proto != nil { if File_pkg_rpc_scheduler_scheduler_proto != nil {
return return
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_internal_rpc_scheduler_scheduler_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerTaskRequest); i { switch v := v.(*PeerTaskRequest); i {
case 0: case 0:
return &v.state return &v.state
@ -1142,7 +1136,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterResult); i { switch v := v.(*RegisterResult); i {
case 0: case 0:
return &v.state return &v.state
@ -1154,7 +1148,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SinglePiece); i { switch v := v.(*SinglePiece); i {
case 0: case 0:
return &v.state return &v.state
@ -1166,7 +1160,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerHost); i { switch v := v.(*PeerHost); i {
case 0: case 0:
return &v.state return &v.state
@ -1178,7 +1172,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PieceResult); i { switch v := v.(*PieceResult); i {
case 0: case 0:
return &v.state return &v.state
@ -1190,7 +1184,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerPacket); i { switch v := v.(*PeerPacket); i {
case 0: case 0:
return &v.state return &v.state
@ -1202,7 +1196,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerResult); i { switch v := v.(*PeerResult); i {
case 0: case 0:
return &v.state return &v.state
@ -1214,7 +1208,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerTarget); i { switch v := v.(*PeerTarget); i {
case 0: case 0:
return &v.state return &v.state
@ -1226,7 +1220,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
return nil return nil
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { file_pkg_rpc_scheduler_scheduler_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PeerPacket_DestPeer); i { switch v := v.(*PeerPacket_DestPeer); i {
case 0: case 0:
return &v.state return &v.state
@ -1239,7 +1233,7 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
} }
} }
} }
file_internal_rpc_scheduler_scheduler_proto_msgTypes[1].OneofWrappers = []interface{}{ file_pkg_rpc_scheduler_scheduler_proto_msgTypes[1].OneofWrappers = []interface{}{
(*RegisterResult_SinglePiece)(nil), (*RegisterResult_SinglePiece)(nil),
(*RegisterResult_PieceContent)(nil), (*RegisterResult_PieceContent)(nil),
} }
@ -1247,18 +1241,18 @@ func file_internal_rpc_scheduler_scheduler_proto_init() {
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_rpc_scheduler_scheduler_proto_rawDesc, RawDescriptor: file_pkg_rpc_scheduler_scheduler_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 9, NumMessages: 9,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },
GoTypes: file_internal_rpc_scheduler_scheduler_proto_goTypes, GoTypes: file_pkg_rpc_scheduler_scheduler_proto_goTypes,
DependencyIndexes: file_internal_rpc_scheduler_scheduler_proto_depIdxs, DependencyIndexes: file_pkg_rpc_scheduler_scheduler_proto_depIdxs,
MessageInfos: file_internal_rpc_scheduler_scheduler_proto_msgTypes, MessageInfos: file_pkg_rpc_scheduler_scheduler_proto_msgTypes,
}.Build() }.Build()
File_internal_rpc_scheduler_scheduler_proto = out.File File_pkg_rpc_scheduler_scheduler_proto = out.File
file_internal_rpc_scheduler_scheduler_proto_rawDesc = nil file_pkg_rpc_scheduler_scheduler_proto_rawDesc = nil
file_internal_rpc_scheduler_scheduler_proto_goTypes = nil file_pkg_rpc_scheduler_scheduler_proto_goTypes = nil
file_internal_rpc_scheduler_scheduler_proto_depIdxs = nil file_pkg_rpc_scheduler_scheduler_proto_depIdxs = nil
} }

View File

@ -0,0 +1,815 @@
// Code generated by protoc-gen-validate. DO NOT EDIT.
// source: pkg/rpc/scheduler/scheduler.proto
package scheduler
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"google.golang.org/protobuf/types/known/anypb"
base "d7y.io/dragonfly/v2/pkg/rpc/base"
)
// ensure the imports are used
var (
_ = bytes.MinRead
_ = errors.New("")
_ = fmt.Print
_ = utf8.UTFMax
_ = (*regexp.Regexp)(nil)
_ = (*strings.Reader)(nil)
_ = net.IPv4len
_ = time.Duration(0)
_ = (*url.URL)(nil)
_ = (*mail.Address)(nil)
_ = anypb.Any{}
_ = base.SizeScope(0)
_ = base.Code(0)
_ = base.Code(0)
_ = base.Code(0)
)
// Validate checks the field values on PeerTaskRequest with the rules defined
// in the proto definition for this message. If any rules are violated, an
// error is returned.
func (m *PeerTaskRequest) Validate() error {
if m == nil {
return nil
}
// no validation rules for Url
// no validation rules for Filter
// no validation rules for BizId
if v, ok := interface{}(m.GetUrlMeta()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerTaskRequestValidationError{
field: "UrlMeta",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for PeerId
if v, ok := interface{}(m.GetPeerHost()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerTaskRequestValidationError{
field: "PeerHost",
reason: "embedded message failed validation",
cause: err,
}
}
}
if v, ok := interface{}(m.GetHostLoad()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerTaskRequestValidationError{
field: "HostLoad",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for IsMigrating
return nil
}
// PeerTaskRequestValidationError is the validation error returned by
// PeerTaskRequest.Validate if the designated constraints aren't met.
type PeerTaskRequestValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerTaskRequestValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerTaskRequestValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerTaskRequestValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerTaskRequestValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerTaskRequestValidationError) ErrorName() string { return "PeerTaskRequestValidationError" }
// Error satisfies the builtin error interface
func (e PeerTaskRequestValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerTaskRequest.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerTaskRequestValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerTaskRequestValidationError{}
// Validate checks the field values on RegisterResult with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *RegisterResult) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for SizeScope
switch m.DirectPiece.(type) {
case *RegisterResult_SinglePiece:
if v, ok := interface{}(m.GetSinglePiece()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return RegisterResultValidationError{
field: "SinglePiece",
reason: "embedded message failed validation",
cause: err,
}
}
}
case *RegisterResult_PieceContent:
// no validation rules for PieceContent
}
return nil
}
// RegisterResultValidationError is the validation error returned by
// RegisterResult.Validate if the designated constraints aren't met.
type RegisterResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e RegisterResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e RegisterResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e RegisterResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e RegisterResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e RegisterResultValidationError) ErrorName() string { return "RegisterResultValidationError" }
// Error satisfies the builtin error interface
func (e RegisterResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sRegisterResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = RegisterResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = RegisterResultValidationError{}
// Validate checks the field values on SinglePiece with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *SinglePiece) Validate() error {
if m == nil {
return nil
}
// no validation rules for DstPid
// no validation rules for DstAddr
if v, ok := interface{}(m.GetPieceInfo()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return SinglePieceValidationError{
field: "PieceInfo",
reason: "embedded message failed validation",
cause: err,
}
}
}
return nil
}
// SinglePieceValidationError is the validation error returned by
// SinglePiece.Validate if the designated constraints aren't met.
type SinglePieceValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e SinglePieceValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e SinglePieceValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e SinglePieceValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e SinglePieceValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e SinglePieceValidationError) ErrorName() string { return "SinglePieceValidationError" }
// Error satisfies the builtin error interface
func (e SinglePieceValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sSinglePiece.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = SinglePieceValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = SinglePieceValidationError{}
// Validate checks the field values on PeerHost with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PeerHost) Validate() error {
if m == nil {
return nil
}
// no validation rules for Uuid
// no validation rules for Ip
// no validation rules for RpcPort
// no validation rules for DownPort
// no validation rules for HostName
// no validation rules for SecurityDomain
// no validation rules for Location
// no validation rules for Idc
// no validation rules for NetTopology
return nil
}
// PeerHostValidationError is the validation error returned by
// PeerHost.Validate if the designated constraints aren't met.
type PeerHostValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerHostValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerHostValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerHostValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerHostValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerHostValidationError) ErrorName() string { return "PeerHostValidationError" }
// Error satisfies the builtin error interface
func (e PeerHostValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerHost.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerHostValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerHostValidationError{}
// Validate checks the field values on PieceResult with the rules defined in
// the proto definition for this message. If any rules are violated, an error
// is returned.
func (m *PieceResult) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for SrcPid
// no validation rules for DstPid
// no validation rules for PieceNum
// no validation rules for BeginTime
// no validation rules for EndTime
// no validation rules for Success
// no validation rules for Code
if v, ok := interface{}(m.GetHostLoad()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PieceResultValidationError{
field: "HostLoad",
reason: "embedded message failed validation",
cause: err,
}
}
}
// no validation rules for FinishedCount
return nil
}
// PieceResultValidationError is the validation error returned by
// PieceResult.Validate if the designated constraints aren't met.
type PieceResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PieceResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PieceResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PieceResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PieceResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PieceResultValidationError) ErrorName() string { return "PieceResultValidationError" }
// Error satisfies the builtin error interface
func (e PieceResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPieceResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PieceResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PieceResultValidationError{}
// Validate checks the field values on PeerPacket with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PeerPacket) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for SrcPid
// no validation rules for ParallelCount
if v, ok := interface{}(m.GetMainPeer()).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerPacketValidationError{
field: "MainPeer",
reason: "embedded message failed validation",
cause: err,
}
}
}
for idx, item := range m.GetStealPeers() {
_, _ = idx, item
if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return PeerPacketValidationError{
field: fmt.Sprintf("StealPeers[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for Code
return nil
}
// PeerPacketValidationError is the validation error returned by
// PeerPacket.Validate if the designated constraints aren't met.
type PeerPacketValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerPacketValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerPacketValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerPacketValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerPacketValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerPacketValidationError) ErrorName() string { return "PeerPacketValidationError" }
// Error satisfies the builtin error interface
func (e PeerPacketValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerPacket.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerPacketValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerPacketValidationError{}
// Validate checks the field values on PeerResult with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PeerResult) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for PeerId
// no validation rules for SrcIp
// no validation rules for SecurityDomain
// no validation rules for Idc
// no validation rules for Url
// no validation rules for ContentLength
// no validation rules for Traffic
// no validation rules for Cost
// no validation rules for Success
// no validation rules for Code
return nil
}
// PeerResultValidationError is the validation error returned by
// PeerResult.Validate if the designated constraints aren't met.
type PeerResultValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerResultValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerResultValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerResultValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerResultValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerResultValidationError) ErrorName() string { return "PeerResultValidationError" }
// Error satisfies the builtin error interface
func (e PeerResultValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerResult.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerResultValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerResultValidationError{}
// Validate checks the field values on PeerTarget with the rules defined in the
// proto definition for this message. If any rules are violated, an error is returned.
func (m *PeerTarget) Validate() error {
if m == nil {
return nil
}
// no validation rules for TaskId
// no validation rules for PeerId
return nil
}
// PeerTargetValidationError is the validation error returned by
// PeerTarget.Validate if the designated constraints aren't met.
type PeerTargetValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerTargetValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerTargetValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerTargetValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerTargetValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerTargetValidationError) ErrorName() string { return "PeerTargetValidationError" }
// Error satisfies the builtin error interface
func (e PeerTargetValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerTarget.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerTargetValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerTargetValidationError{}
// Validate checks the field values on PeerPacket_DestPeer with the rules
// defined in the proto definition for this message. If any rules are
// violated, an error is returned.
func (m *PeerPacket_DestPeer) Validate() error {
if m == nil {
return nil
}
// no validation rules for Ip
// no validation rules for RpcPort
// no validation rules for PeerId
return nil
}
// PeerPacket_DestPeerValidationError is the validation error returned by
// PeerPacket_DestPeer.Validate if the designated constraints aren't met.
type PeerPacket_DestPeerValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PeerPacket_DestPeerValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PeerPacket_DestPeerValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PeerPacket_DestPeerValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PeerPacket_DestPeerValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PeerPacket_DestPeerValidationError) ErrorName() string {
return "PeerPacket_DestPeerValidationError"
}
// Error satisfies the builtin error interface
func (e PeerPacket_DestPeerValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPeerPacket_DestPeer.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PeerPacket_DestPeerValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PeerPacket_DestPeerValidationError{}

View File

@ -18,10 +18,10 @@ syntax = "proto3";
package scheduler; package scheduler;
import "internal/rpc/base/base.proto"; import "pkg/rpc/base/base.proto";
import "google/protobuf/empty.proto"; import "google/protobuf/empty.proto";
option go_package = "d7y.io/dragonfly/v2/internal/rpc/scheduler"; option go_package = "d7y.io/dragonfly/v2/pkg/rpc/scheduler";
message PeerTaskRequest{ message PeerTaskRequest{
// universal resource locator for different kind of storage // universal resource locator for different kind of storage

View File

@ -247,5 +247,5 @@ var _Scheduler_serviceDesc = grpc.ServiceDesc{
ClientStreams: true, ClientStreams: true,
}, },
}, },
Metadata: "internal/rpc/scheduler/scheduler.proto", Metadata: "pkg/rpc/scheduler/scheduler.proto",
} }

View File

@ -24,7 +24,9 @@ import (
"hash" "hash"
"io" "io"
"os" "os"
"strings"
"d7y.io/dragonfly/v2/internal/constants"
"d7y.io/dragonfly/v2/pkg/unit" "d7y.io/dragonfly/v2/pkg/unit"
"d7y.io/dragonfly/v2/pkg/util/fileutils" "d7y.io/dragonfly/v2/pkg/util/fileutils"
) )
@ -59,19 +61,28 @@ func Md5Bytes(bytes []byte) string {
return ToHashString(h) return ToHashString(h)
} }
func Md5File(name string) string { // HashFile computes hash value corresponding to hashType,
if !fileutils.IsRegular(name) { // hashType is from constants.Md5Hash and constants.Sha256Hash.
func HashFile(file string, hashType string) string {
if !fileutils.IsRegular(file) {
return "" return ""
} }
f, err := os.Open(name) f, err := os.Open(file)
if err != nil { if err != nil {
return "" return ""
} }
defer f.Close() defer f.Close()
h := md5.New() var h hash.Hash
if hashType == constants.Md5Hash {
h = md5.New()
} else if hashType == constants.Sha256Hash {
h = sha256.New()
} else {
return ""
}
r := bufio.NewReaderSize(f, int(4*unit.MB)) r := bufio.NewReaderSize(f, int(4*unit.MB))
@ -86,3 +97,8 @@ func Md5File(name string) string {
func ToHashString(h hash.Hash) string { func ToHashString(h hash.Hash) string {
return hex.EncodeToString(h.Sum(nil)) return hex.EncodeToString(h.Sum(nil))
} }
func Parse(digest string) []string {
digest = strings.Trim(digest, " ")
return strings.Split(digest, ":")
}

View File

@ -22,6 +22,7 @@ import (
"syscall" "syscall"
"testing" "testing"
"d7y.io/dragonfly/v2/internal/constants"
"d7y.io/dragonfly/v2/pkg/basic" "d7y.io/dragonfly/v2/pkg/basic"
"d7y.io/dragonfly/v2/pkg/util/fileutils" "d7y.io/dragonfly/v2/pkg/util/fileutils"
"github.com/google/uuid" "github.com/google/uuid"
@ -50,7 +51,7 @@ func TestMd5Reader(t *testing.T) {
assert.Equal(t, expected, Md5Reader(strings.NewReader("hello"))) assert.Equal(t, expected, Md5Reader(strings.NewReader("hello")))
} }
func TestMd5File(t *testing.T) { func TestHashFile(t *testing.T) {
var expected = "5d41402abc4b2a76b9719d911017c592" var expected = "5d41402abc4b2a76b9719d911017c592"
path := basic.TmpDir + "/" + uuid.New().String() path := basic.TmpDir + "/" + uuid.New().String()
@ -60,5 +61,5 @@ func TestMd5File(t *testing.T) {
f.Write([]byte("hello")) f.Write([]byte("hello"))
f.Close() f.Close()
assert.Equal(t, expected, Md5File(path)) assert.Equal(t, expected, HashFile(path, constants.Md5Hash))
} }

View File

@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
// Package fileutils provides utilities supplementing the standard about file packages.
package fileutils package fileutils
import ( import (