Documentation
¶
Index ¶
- Constants
- Variables
- func Main(args []string)
- func UTCNow() time.Time
- type GetObjectReader
- type LRWMutex
- func (lm *LRWMutex) DRLocker() sync.Locker
- func (lm *LRWMutex) ForceUnlock()
- func (lm *LRWMutex) GetLock(ctx context.Context, id string, source string, timeout time.Duration) (locked bool)
- func (lm *LRWMutex) GetRLock(ctx context.Context, id string, source string, timeout time.Duration) (locked bool)
- func (lm *LRWMutex) Lock()
- func (lm *LRWMutex) RLock()
- func (lm *LRWMutex) RUnlock()
- func (lm *LRWMutex) Unlock()
- type LockContext
- type LockType
- type MinIOObjects
- type ObjectLayer
- type OperationTimedOut
- type RWLocker
- type ResObject
- type ResObjectInfo
Constants ¶
View Source
const ( GlobalMinCDNDefaultPort = "9006" GlobalImgeContentTypePrefix = "image/" GlobalDefaultImgeContentType = "image/jpeg" GlobalMemoryCacheSize = 1 * humanize.GiByte )
View Source
const SlashSeparator = "/"
Variables ¶
View Source
var GlobalContext context.Context
View Source
var GlobalFlags = []cli.Flag{ cli.BoolFlag{ Name: "UseEtcd", Usage: "use etcd to register minCDN service", }, cli.StringFlag{ Name: "EtcdAddress", Usage: "etcd Address", EnvVar: "MINCDN_ETCD_ADDRESS", }, cli.StringFlag{ Name: "address", Value: ":" + GlobalMinCDNDefaultPort, Usage: "bind to service address", EnvVar: "MINCDN_ADDRESS", }, cli.StringFlag{ Name: "MinioEndpoint", Usage: "MininEndpoint", }, cli.StringFlag{ Name: "MinioAccessID", Usage: "MinioAccessID", }, cli.StringFlag{ Name: "MinioSecret", Usage: "MinioSecret", }, cli.IntFlag{ Name: "MemoryCacheSize", Usage: "Set Memory Cache Size", Value: GlobalMemoryCacheSize, }, }
Functions ¶
Types ¶
type GetObjectReader ¶
type GetObjectReader struct {
io.Reader
ObjInfo ResObjectInfo
}
type LRWMutex ¶
type LRWMutex struct {
// contains filtered or unexported fields
}
A LRWMutex is a mutual exclusion lock with timeouts.
func (*LRWMutex) DRLocker ¶
DRLocker returns a sync.Locker interface that implements the Lock and Unlock methods by calling drw.RLock and drw.RUnlock.
func (*LRWMutex) ForceUnlock ¶
func (lm *LRWMutex) ForceUnlock()
ForceUnlock will forcefully clear a write or read lock.
func (*LRWMutex) GetLock ¶
func (lm *LRWMutex) GetLock(ctx context.Context, id string, source string, timeout time.Duration) (locked bool)
GetLock tries to get a write lock on lm before the timeout occurs.
func (*LRWMutex) GetRLock ¶
func (lm *LRWMutex) GetRLock(ctx context.Context, id string, source string, timeout time.Duration) (locked bool)
GetRLock tries to get a read lock on lm before the timeout occurs.
func (*LRWMutex) Lock ¶
func (lm *LRWMutex) Lock()
Lock holds a write lock on lm.
If the lock is already in use, the calling go routine blocks until the mutex is available.
func (*LRWMutex) RLock ¶
func (lm *LRWMutex) RLock()
RLock holds a read lock on lm.
If one or more read lock are already in use, it will grant another lock. Otherwise the calling go routine blocks until the mutex is available.
type LockContext ¶
type LockContext struct {
// contains filtered or unexported fields
}
func (LockContext) Cancel ¶
func (l LockContext) Cancel()
func (LockContext) Context ¶
func (l LockContext) Context() context.Context
type MinIOObjects ¶
type MinIOObjects struct {
// contains filtered or unexported fields
}
func (*MinIOObjects) GetResInfo ¶
func (*MinIOObjects) NewNSLock ¶
func (fs *MinIOObjects) NewNSLock(recUri string) RWLocker
type ObjectLayer ¶
type ObjectLayer interface {
NewNSLock(recUri string) RWLocker
GetResInfo(ctx context.Context, bucket, object, resUri string, h http.Header, lockType LockType, clientObjInfo ResObjectInfo) (resBuffer *bufio.Reader, statusCode int, err error)
}
func NewMinIOObjectLayer ¶
func NewMinIOObjectLayer(endPoint, accessKeyID, secretAccessKey string, useSSL bool) (ObjectLayer, error)
type OperationTimedOut ¶
type OperationTimedOut struct {
}
func (OperationTimedOut) Error ¶
func (e OperationTimedOut) Error() string
type RWLocker ¶
type RWLocker interface {
GetLock(ctx context.Context, timeout *dynamicTimeout) (lkCtx LockContext, timedOutErr error)
Unlock(cancel context.CancelFunc)
GetRLock(ctx context.Context, timeout *dynamicTimeout) (lkCtx LockContext, timedOutErr error)
RUnlock(cancel context.CancelFunc)
}
type ResObject ¶
type ResObject struct {
ByteData []byte
ObjInfo ResObjectInfo
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.