Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Embedded GOGS API client *gogs.Client // GIN client for running git and git-annex operations. Also implements // some of the GOGS client functionality. GIN *ginclient.Client // contains filtered or unexported fields }
Client embeds gogs.Client to extend functionality with new convenience methods. (New clients may be added in the future using the same interface).
func (*Client) CloneRepo ¶
CloneRepo clones repository 'repo' into directory 'destdir'. The repository should be in the form user/repository, without any server information. The server address is configured in the client.
func (*Client) InitGINClient ¶
InitGINClient logs in to the GIN server, sets up the local configuration, and returns a new ginclient.Client instance for running git and git-annex commands.
type PostAction ¶
PostAction is a function that receives the form values when the form is submitted. It should perform actions for the user through the service given the form values and return a list of messages and/or an error if it fails.
type PreAction ¶
PreAction is a function that receives the Form struct as defined for the service. It should return modified Form struct with values, constraints, or elements modified based on the permissions or actions supported for the bot and/or user, or any other external constraint that the function can evaluate.
type UserJob ¶
UserJob extends db.Job with a user token to perform authenticated tasks on behalf of a given user.
type Worker ¶
type Worker struct { // PreAction is used to prepare data to show the user, such as populating // form lists or showing information on static pages. PreAction PreAction // PostAction PostAction PostAction // contains filtered or unexported fields }
Worker pool with queue for running Jobs asynchronously.
func New ¶
func New(dbconn *db.Connection) *Worker
New returns a new Worker attached to the given database.
func (*Worker) PreprocessForm ¶
PreprocessForm runs the defined PreAction and returns a modified Form.
func (*Worker) SetLogger ¶
SetLogger sets the logger instance for the worker service. If unset the service defines its own logger with the same configuration as the standard Logger.