Documentation ¶
Overview ¶
*Copyright (c) 2022, kaydxh * *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.
*Copyright (c) 2022, kaydxh * *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.
*Copyright (c) 2022, kaydxh * *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.
*Copyright (c) 2022, kaydxh * *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.
*Copyright (c) 2022, kaydxh * *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.
*Copyright (c) 2022, kaydxh * *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.
Index ¶
- Variables
- type CompletedConfig
- type Config
- type ConfigOption
- type ConfigOptionFunc
- type EmptyConfigOption
- type EmptyFileTransferOption
- type FileTransfer
- type FileTransferOption
- func WithDownloadTimeout(downloadTimeout time.Duration) FileTransferOption
- func WithLoadBalanceMode(mode Ft_LoadBalanceMode) FileTransferOption
- func WithProxies(proxies []*Ft_Proxy) FileTransferOption
- func WithRetryInterval(retryInterval time.Duration) FileTransferOption
- func WithRetryTimes(retryTimes int) FileTransferOption
- type FileTransferOptionFunc
- type FileTransferOptions
- type Ft
- func (*Ft) Descriptor() ([]byte, []int)deprecated
- func (x *Ft) GetDownloadTimeout() *duration.Duration
- func (x *Ft) GetEnabled() bool
- func (x *Ft) GetLoadBalanceMode() Ft_LoadBalanceMode
- func (x *Ft) GetProxies() []*Ft_Proxy
- func (x *Ft) GetRetryInterval() *duration.Duration
- func (x *Ft) GetRetryTimes() uint32
- func (x *Ft) GetUploadTimeout() *duration.Duration
- func (*Ft) ProtoMessage()
- func (x *Ft) ProtoReflect() protoreflect.Message
- func (x *Ft) Reset()
- func (x *Ft) String() string
- type Ft_LoadBalanceMode
- func (Ft_LoadBalanceMode) Descriptor() protoreflect.EnumDescriptor
- func (x Ft_LoadBalanceMode) Enum() *Ft_LoadBalanceMode
- func (Ft_LoadBalanceMode) EnumDescriptor() ([]byte, []int)deprecated
- func (x Ft_LoadBalanceMode) Number() protoreflect.EnumNumber
- func (x Ft_LoadBalanceMode) String() string
- func (Ft_LoadBalanceMode) Type() protoreflect.EnumType
- type Ft_Proxy
- func (*Ft_Proxy) Descriptor() ([]byte, []int)deprecated
- func (x *Ft_Proxy) GetProxyHost() string
- func (x *Ft_Proxy) GetProxyUrl() string
- func (x *Ft_Proxy) GetTargetHost() string
- func (*Ft_Proxy) ProtoMessage()
- func (x *Ft_Proxy) ProtoReflect() protoreflect.Message
- func (x *Ft_Proxy) Reset()
- func (x *Ft_Proxy) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Ft_LoadBalanceMode_name = map[int32]string{ 0: "load_balance_mode_first", 1: "load_balance_mode_random", } Ft_LoadBalanceMode_value = map[string]int32{ "load_balance_mode_first": 0, "load_balance_mode_random": 1, } )
Enum value maps for Ft_LoadBalanceMode.
var File_pkg_file_transfer_ft_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
type Config ¶
type Config struct { Proto Ft // contains filtered or unexported fields }
func NewConfig ¶
func NewConfig(options ...ConfigOption) *Config
func (*Config) ApplyOptions ¶
func (o *Config) ApplyOptions(options ...ConfigOption) *Config
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete set default ServerRunOptions.
type ConfigOption ¶
type ConfigOption interface {
// contains filtered or unexported methods
}
A ConfigOption sets options.
func WithViper ¶
func WithViper(v *viper.Viper) ConfigOption
type ConfigOptionFunc ¶
type ConfigOptionFunc func(*Config)
ConfigOptionFunc wraps a function that modifies Client into an implementation of the ConfigOption interface.
type EmptyConfigOption ¶
type EmptyConfigOption struct{}
EmptyConfigOption does not alter the configuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type EmptyFileTransferOption ¶
type EmptyFileTransferOption struct{}
EmptyFileTransferUrlOption does not alter the FileTransferuration. It can be embedded in another structure to build custom options.
This API is EXPERIMENTAL.
type FileTransfer ¶
type FileTransfer struct {
// contains filtered or unexported fields
}
func NewFileTransfer ¶
func NewFileTransfer(opts ...FileTransferOption) *FileTransfer
func (*FileTransfer) ApplyOptions ¶
func (o *FileTransfer) ApplyOptions(options ...FileTransferOption) *FileTransfer
type FileTransferOption ¶
type FileTransferOption interface {
// contains filtered or unexported methods
}
A FileTransferOption sets options.
func WithDownloadTimeout ¶
func WithDownloadTimeout(downloadTimeout time.Duration) FileTransferOption
func WithLoadBalanceMode ¶ added in v0.0.103
func WithLoadBalanceMode(mode Ft_LoadBalanceMode) FileTransferOption
func WithProxies ¶ added in v0.0.103
func WithProxies(proxies []*Ft_Proxy) FileTransferOption
func WithRetryInterval ¶ added in v0.0.103
func WithRetryInterval(retryInterval time.Duration) FileTransferOption
func WithRetryTimes ¶ added in v0.0.103
func WithRetryTimes(retryTimes int) FileTransferOption
type FileTransferOptionFunc ¶
type FileTransferOptionFunc func(*FileTransfer)
FileTransferOptionFunc wraps a function that modifies FileTransfer into an implementation of the FileTransferOption interface.
type FileTransferOptions ¶
type FileTransferOptions struct {
// contains filtered or unexported fields
}
type Ft ¶
type Ft struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` DownloadTimeout *duration.Duration `protobuf:"bytes,2,opt,name=download_timeout,json=downloadTimeout,proto3" json:"download_timeout,omitempty"` UploadTimeout *duration.Duration `protobuf:"bytes,3,opt,name=upload_timeout,json=uploadTimeout,proto3" json:"upload_timeout,omitempty"` RetryTimes uint32 `protobuf:"varint,4,opt,name=retry_times,json=retryTimes,proto3" json:"retry_times,omitempty"` RetryInterval *duration.Duration `protobuf:"bytes,5,opt,name=retry_interval,json=retryInterval,proto3" json:"retry_interval,omitempty"` // 当有多个代理地址时,代理模式, use proxy mode LoadBalanceMode Ft_LoadBalanceMode `` /* 154-byte string literal not displayed */ Proxies []*Ft_Proxy `protobuf:"bytes,11,rep,name=proxies,proto3" json:"proxies,omitempty"` // contains filtered or unexported fields }
func (*Ft) Descriptor
deprecated
func (*Ft) GetDownloadTimeout ¶
func (*Ft) GetEnabled ¶
func (*Ft) GetLoadBalanceMode ¶ added in v0.0.103
func (x *Ft) GetLoadBalanceMode() Ft_LoadBalanceMode
func (*Ft) GetProxies ¶
func (*Ft) GetRetryInterval ¶ added in v0.0.103
func (*Ft) GetRetryTimes ¶ added in v0.0.103
func (*Ft) GetUploadTimeout ¶
func (*Ft) ProtoMessage ¶
func (*Ft) ProtoMessage()
func (*Ft) ProtoReflect ¶
func (x *Ft) ProtoReflect() protoreflect.Message
type Ft_LoadBalanceMode ¶ added in v0.0.103
type Ft_LoadBalanceMode int32
const ( Ft_load_balance_mode_first Ft_LoadBalanceMode = 0 Ft_load_balance_mode_random Ft_LoadBalanceMode = 1 )
func (Ft_LoadBalanceMode) Descriptor ¶ added in v0.0.103
func (Ft_LoadBalanceMode) Descriptor() protoreflect.EnumDescriptor
func (Ft_LoadBalanceMode) Enum ¶ added in v0.0.103
func (x Ft_LoadBalanceMode) Enum() *Ft_LoadBalanceMode
func (Ft_LoadBalanceMode) EnumDescriptor
deprecated
added in
v0.0.103
func (Ft_LoadBalanceMode) EnumDescriptor() ([]byte, []int)
Deprecated: Use Ft_LoadBalanceMode.Descriptor instead.
func (Ft_LoadBalanceMode) Number ¶ added in v0.0.103
func (x Ft_LoadBalanceMode) Number() protoreflect.EnumNumber
func (Ft_LoadBalanceMode) String ¶ added in v0.0.103
func (x Ft_LoadBalanceMode) String() string
func (Ft_LoadBalanceMode) Type ¶ added in v0.0.103
func (Ft_LoadBalanceMode) Type() protoreflect.EnumType
type Ft_Proxy ¶
type Ft_Proxy struct { // target_addr和target_url都设置值的情况下,优先使用target_addr // reset dns to target_addr in url, TargetHost string `protobuf:"bytes,1,opt,name=target_host,json=targetHost,proto3" json:"target_host,omitempty"` // reset url to target url ProxyUrl string `protobuf:"bytes,2,opt,name=proxy_url,json=proxyUrl,proto3" json:"proxy_url,omitempty"` ProxyHost string `protobuf:"bytes,3,opt,name=proxy_host,json=proxyHost,proto3" json:"proxy_host,omitempty"` // contains filtered or unexported fields }
func (*Ft_Proxy) Descriptor
deprecated
func (*Ft_Proxy) GetProxyHost ¶ added in v0.0.117
func (*Ft_Proxy) GetProxyUrl ¶ added in v0.0.117
func (*Ft_Proxy) GetTargetHost ¶ added in v0.0.117
func (*Ft_Proxy) ProtoMessage ¶
func (*Ft_Proxy) ProtoMessage()
func (*Ft_Proxy) ProtoReflect ¶
func (x *Ft_Proxy) ProtoReflect() protoreflect.Message
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
*Copyright (c) 2022, kaydxh * *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.
|
*Copyright (c) 2022, kaydxh * *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. |