Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToUint16(b []byte) (v uint16)
- func BytesToUint32(b []byte) (v uint32)
- func BytesToUint64(b []byte) (v uint64)
- func Delete(url string, jwt string) error
- func Do(req *http.Request) (resp *http.Response, err error)
- func DownloadFile(fileUrl string) (filename string, header http.Header, rc io.ReadCloser, e error)
- func FileExists(filename string) bool
- func Get(url string) ([]byte, error)
- func GetBufferStream(url string, values url.Values, allocatedBytes []byte, eachBuffer func([]byte)) error
- func GetFileSize(file *os.File) (size int64, err error)
- func GetFileUidGid(fi os.FileInfo) (uid, gid uint32)
- func GetUrlStream(url string, values url.Values, readFn func(io.Reader) error) error
- func GrpcDial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
- func GzipData(input []byte) ([]byte, error)
- func Head(url string) (http.Header, error)
- func IsGzippable(ext, mtype string, data []byte) bool
- func IsGzippableFileType(ext, mtype string) (shouldBeZipped, iAmSure bool)
- func LoadConfiguration(configFileName string, required bool) (loaded bool)
- func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server
- func NewListener(addr string, timeout time.Duration) (net.Listener, error)
- func NormalizeUrl(url string) string
- func OnInterrupt(fn func())
- func ParseInt(text string, defaultValue int) int
- func ParseServerToGrpcAddress(server string) (serverGrpcAddress string, err error)
- func ParseUint64(text string, defaultValue uint64) uint64
- func Post(url string, values url.Values) ([]byte, error)
- func PostBytes(url string, body []byte) ([]byte, error)
- func ReadUrl(fileUrl string, offset int64, size int, buf []byte, isReadRange bool) (n int64, e error)
- func ReadUrlAsStream(fileUrl string, offset int64, size int, fn func(data []byte)) (n int64, e error)
- func ServerToGrpcAddress(server string) (serverGrpcAddress string)
- func SetupProfiling(cpuProfile, memProfile string)
- func TestFolderWritable(folder string) (err error)
- func Uint16toBytes(b []byte, v uint16)
- func Uint32toBytes(b []byte, v uint32)
- func Uint64toBytes(b []byte, v uint64)
- func Uint8toBytes(b []byte, v uint8)
- func UnGzipData(input []byte) ([]byte, error)
- func WithCachedGrpcClient(ctx context.Context, fn func(*grpc.ClientConn) error, address string, ...) error
- type ConcurrentReadMap
- type Configuration
- type Conn
- type Listener
- type WriteThrottler
Constants ¶
View Source
const (
VolumeSizeLimitGB = 30
)
Variables ¶
View Source
var (
Transport *http.Transport
)
View Source
var (
VERSION = fmt.Sprintf("%s %d.%d", sizeLimit, 1, 43)
)
Functions ¶
func BytesToUint16 ¶
func BytesToUint32 ¶
func BytesToUint64 ¶
func DownloadFile ¶
func FileExists ¶
func Get ¶
github.com/chrislusf/seaweedfs/unmaintained/repeated_vacuum/repeated_vacuum.go may need increasing http.Client.Timeout
func GetBufferStream ¶
func GetFileUidGid ¶
func GetUrlStream ¶
func GrpcDial ¶
func GrpcDial(ctx context.Context, address string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
func IsGzippable ¶
func IsGzippableFileType ¶
func LoadConfiguration ¶
func NewGrpcServer ¶
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server
func NormalizeUrl ¶
func OnInterrupt ¶
func OnInterrupt(fn func())
func ParseUint64 ¶
func ReadUrlAsStream ¶
func ServerToGrpcAddress ¶
func SetupProfiling ¶
func SetupProfiling(cpuProfile, memProfile string)
func TestFolderWritable ¶
func Uint16toBytes ¶
func Uint32toBytes ¶
func Uint64toBytes ¶
func Uint8toBytes ¶
func UnGzipData ¶
func WithCachedGrpcClient ¶
func WithCachedGrpcClient(ctx context.Context, fn func(*grpc.ClientConn) error, address string, opts ...grpc.DialOption) error
Types ¶
type ConcurrentReadMap ¶
A mostly for read map, which can thread-safely initialize the map entries.
func NewConcurrentReadMap ¶
func NewConcurrentReadMap() *ConcurrentReadMap
func (*ConcurrentReadMap) Delete ¶
func (m *ConcurrentReadMap) Delete(key string)
func (*ConcurrentReadMap) Find ¶
func (m *ConcurrentReadMap) Find(key string) (interface{}, bool)
func (*ConcurrentReadMap) Get ¶
func (m *ConcurrentReadMap) Get(key string, newEntry func() interface{}) interface{}
func (*ConcurrentReadMap) Items ¶
func (m *ConcurrentReadMap) Items() (itemsCopy []interface{})
type Configuration ¶
type Listener ¶
Listener wraps a net.Listener, and gives a place to store the timeout parameters. On Accept, it will wrap the net.Conn with our own Conn for us.
type WriteThrottler ¶
type WriteThrottler struct {
// contains filtered or unexported fields
}
func NewWriteThrottler ¶
func NewWriteThrottler(bytesPerSecond int64) *WriteThrottler
func (*WriteThrottler) MaybeSlowdown ¶
func (wt *WriteThrottler) MaybeSlowdown(delta int64)
Click to show internal directories.
Click to hide internal directories.