Documentation
¶
Index ¶
- type AllPossibleParams
- type CropParams
- type DB
- func (db *DB) DeleteTask(id, userId int) error
- func (db *DB) GetTask(id, userId int) (*Task, error)
- func (db *DB) GetUser(id int) (*User, error)
- func (db *DB) GetUserByEmail(email string) (*User, error)
- func (db *DB) InsertTask(task *Task, AfterCreate func(createdTask *Task) error) error
- func (db *DB) InsertUser(email, hashedPassword string) (int, error)
- func (db *DB) ListTasks(userId int, filters Filters) ([]*Task, error)
- func (db *DB) UpdateTask(task *Task) error
- func (db *DB) UpdateUserHashedPassword(id int, hashedPassword string) error
- type Filters
- type FlipParams
- type OperationType
- type Payload
- type ResizeParams
- type RotateParams
- type Task
- type TransformParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllPossibleParams ¶
type CropParams ¶
type CropParams struct { X int `json:"x"` Y int `json:"y"` Width int `json:"width"` Height int `json:"height"` }
CropParams holds the parameters for the Crop operation
type FlipParams ¶
type FlipParams struct {
Axis string `json:"axis"`
}
type OperationType ¶
type OperationType string
const ( Resize OperationType = "resize" Crop OperationType = "crop" Rotate OperationType = "rotate" Flip OperationType = "flip" )
type Payload ¶
type Payload struct { URL string `json:"url"` Operation OperationType `json:"operation"` Params TransformParams `json:"params,omitempty"` }
func (*Payload) UpdateParams ¶
func (p *Payload) UpdateParams(op OperationType, params AllPossibleParams) error
type ResizeParams ¶
ResizeParams holds the parameters for the Resize operation
type RotateParams ¶
type RotateParams struct {
Angle int `json:"angle"`
}
RotateParams holds the parameters for the Rotate operation
type Task ¶
type Task struct { ID int `db:"id" json:"id"` Type string `db:"type" json:"type"` Payload Payload `db:"payload" json:"payload"` Priority int `db:"priority" json:"priority"` Status string `db:"status" json:"status"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Timeout int `db:"timeout" json:"timeout"` RetryCount int `db:"retry_count" json:"retry_count"` MaxRetries int `db:"max_retries" json:"max_retries"` Result string `db:"result" json:"result,omitempty"` UserId int `db:"user_id" json:"-"` }
type TransformParams ¶
type TransformParams struct { ResizeParams ResizeParams CropParams CropParams RotateParams RotateParams FlipParams FlipParams }
Click to show internal directories.
Click to hide internal directories.