Documentation
¶
Index ¶
- func NewDriveClient(ctx context.Context, confdir string) (*http.Client, error)
- func NewServer(addr string, d *Dispatcher, coll *docstore.Collection) *http.Server
- func OpenCollection(ctx context.Context, config *StoreConfig) (*docstore.Collection, error)
- type Config
- type Dispatcher
- type DispatcherStatus
- type StoreConfig
- type Task
- type TaskStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDriveClient ¶
NewDriveClient creates a new client for Google Drive.
func NewServer ¶
func NewServer(addr string, d *Dispatcher, coll *docstore.Collection) *http.Server
NewServer creates a new server.
func OpenCollection ¶
func OpenCollection(ctx context.Context, config *StoreConfig) (*docstore.Collection, error)
OpenCollection opens the collection of tasks.
Types ¶
type Config ¶
type Config struct {
Address string `toml:"addr"`
Store *StoreConfig `toml:"store"`
// Rate represents a byte for token bucket rate per second.
Rate float64 `toml:"rate"`
// Capacity represents a byte for token bucket capacity.
Capacity int64 `toml:"capacity"`
}
Config represents a configuration for vlv.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher represents a dispatcher.
func NewDispatcher ¶
func NewDispatcher(client *http.Client, coll *docstore.Collection, rate float64, capacity int64) *Dispatcher
NewDispatcher creates a new dispatcher.
func (*Dispatcher) Start ¶
func (d *Dispatcher) Start(ctx context.Context)
Start starts to dispatch.
func (*Dispatcher) Status ¶
func (d *Dispatcher) Status() *DispatcherStatus
type DispatcherStatus ¶
type DispatcherStatus struct {
*TaskStatus
Shut bool `json:"shut"`
}
type StoreConfig ¶
StoreConfig represents a configuration for store.
type Task ¶
type Task struct {
Filename string `json:"filename" docstore:"filename"`
Description string `json:"description" docstore:"description"`
Parents []string `json:"parents" docstore:"parents"`
MimeType string `json:"mimeType" docstore:"mimeType"`
CreateTime int64 `json:"createTime" docstore:"createTime"`
DocstoreRevision interface{}
// contains filtered or unexported fields
}
Task represents a task to upload.
func TaskFromRequest ¶
TaskFromRequest creates a new Task from http.Request.
func (*Task) Status ¶
func (t *Task) Status() *TaskStatus
Click to show internal directories.
Click to hide internal directories.