Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) Check(id string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) CherryPick(left, right, pkg string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) Clone(src, dest string) (s *repo.Summary, j *jobs.Job, err error)
- func (c *Client) Close()
- func (c *Client) Compare(left, right string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) Create(id string, instant bool) (j *jobs.Job, err error)
- func (c *Client) Delta(id string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) GetJob(id int) (j *jobs.Job, err error)
- func (c *Client) Import(id string, instant bool) (r *repo.Summary, j *jobs.Job, err error)
- func (c *Client) Index(id string) (j *jobs.Job, err error)
- func (c *Client) Remove(id string) (j *jobs.Job, err error)
- func (c *Client) Repos() (f repo.FullSummary, err error)
- func (c *Client) Rescan(id string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) ResetCompleted() error
- func (c *Client) ResetFailed() error
- func (c *Client) ResetQueued() error
- func (c *Client) Status() (status StatusResponse, err error)
- func (c *Client) Sync(src, dst string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) TrimObsoletes(id string) (d *repo.Diff, j *jobs.Job, err error)
- func (c *Client) TrimPackages(id string, maxKeep int) (d *repo.Diff, j *jobs.Job, err error)
- type GenericResponse
- type Listener
- func (api *Listener) Bind() error
- func (l *Listener) CherryPickRepo(ctx *fasthttp.RequestCtx)
- func (api *Listener) Close()
- func (l *Listener) CompareRepo(ctx *fasthttp.RequestCtx)
- func (l *Listener) CreateRepo(ctx *fasthttp.RequestCtx)
- func (l *Listener) GetJob(ctx *fasthttp.RequestCtx)
- func (l *Listener) ModifyDaemon(ctx *fasthttp.RequestCtx)
- func (l *Listener) ModifyRepo(ctx *fasthttp.RequestCtx)
- func (l *Listener) RemoveRepo(ctx *fasthttp.RequestCtx)
- func (l *Listener) Repos(ctx *fasthttp.RequestCtx)
- func (l *Listener) ResetJobs(ctx *fasthttp.RequestCtx)
- func (api *Listener) Start() error
- func (l *Listener) Status(ctx *fasthttp.RequestCtx)
- func (l *Listener) SyncRepo(ctx *fasthttp.RequestCtx)
- type StatusResponse
Constants ¶
const Version = "1.0.0"
Version is the version of ferryd
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the V1 API
func NewClient ¶
NewClient will return a new ClientV1 for the local unix socket, suitable for communicating with the daemon.
func (*Client) CherryPick ¶
CherryPick will ask the backend to sync a single package from one repo to another
func (*Client) Clone ¶
Clone will ask the backend to clone an existing repository into a new repository
func (*Client) Close ¶
func (c *Client) Close()
Close will kill any idle connections still in "keep-alive" and ensure we're not leaking file descriptors.
func (*Client) Repos ¶
func (c *Client) Repos() (f repo.FullSummary, err error)
Repos will grab a list of repos from the daemon
func (*Client) ResetCompleted ¶
ResetCompleted asks the daemon to reset completed jobs
func (*Client) ResetFailed ¶
ResetFailed asks the daemon to reset failed jobs
func (*Client) ResetQueued ¶
ResetQueued asks the daemon to reset queued jobs
func (*Client) Status ¶
func (c *Client) Status() (status StatusResponse, err error)
Status retrieves the status of the ferryd service
func (*Client) TrimObsoletes ¶
TrimObsoletes will request that all packages marked obsolete are removed
type GenericResponse ¶
type GenericResponse struct { // Errors is a list of errors encountered in this transaction Errors []string `json:"errors"` }
GenericResponse is a catchall for API responses
func (GenericResponse) Print ¶
func (resp GenericResponse) Print(out io.Writer)
Print prints out a list of errors, one by one
type Listener ¶
type Listener struct { // If systemd is enabled, we'll talk to it. SystemdEnabled bool // contains filtered or unexported fields }
Listener sits on a unix socket accepting connections from authenticated client, i.e. root or those in the "ferry" group
func NewListener ¶
NewListener will return a newly initialised Server which is currently unbound
func (*Listener) Bind ¶
Bind will attempt to set up the listener on the unix socket prior to serving.
func (*Listener) CherryPickRepo ¶
func (l *Listener) CherryPickRepo(ctx *fasthttp.RequestCtx)
CherryPickRepo will ask the backend to sync a single package from one repo to another
func (*Listener) CompareRepo ¶
func (l *Listener) CompareRepo(ctx *fasthttp.RequestCtx)
CompareRepo will ask the backend to compare one repo to another
func (*Listener) CreateRepo ¶
func (l *Listener) CreateRepo(ctx *fasthttp.RequestCtx)
CreateRepo will handle remote requests for repository creation
func (*Listener) GetJob ¶
func (l *Listener) GetJob(ctx *fasthttp.RequestCtx)
GetJob handles request the current information about a Job
func (*Listener) ModifyDaemon ¶
func (l *Listener) ModifyDaemon(ctx *fasthttp.RequestCtx)
ModifyDaemon makes a requested change to the daemon
func (*Listener) ModifyRepo ¶
func (l *Listener) ModifyRepo(ctx *fasthttp.RequestCtx)
ModifyRepo performs a modification to an existing repo
func (*Listener) RemoveRepo ¶
func (l *Listener) RemoveRepo(ctx *fasthttp.RequestCtx)
RemoveRepo will handle remote requests for repository deletion
func (*Listener) Repos ¶
func (l *Listener) Repos(ctx *fasthttp.RequestCtx)
Repos will attempt to serialise our known repositories into a response
func (*Listener) ResetJobs ¶
func (l *Listener) ResetJobs(ctx *fasthttp.RequestCtx)
ResetJobs will ask the job store to remove jobs of a certain status
func (*Listener) Status ¶
func (l *Listener) Status(ctx *fasthttp.RequestCtx)
Status will return the current status of the ferryd instance
func (*Listener) SyncRepo ¶
func (l *Listener) SyncRepo(ctx *fasthttp.RequestCtx)
SyncRepo will ask the backend to sync one repo to another
type StatusResponse ¶
type StatusResponse struct { GenericResponse // TimeStarted is the time when the daemon was last started TimeStarted time.Time `json:"time_started"` // Version is the version of the daemon Version string `json:"version"` // CurrentJobs is a list of running and queued jobs Current jobs.List `json:"current"` // FailedJobs is a list of failed jobs Failed jobs.List `json:"failed"` // CompletedJobs is a list of completed jobs Completed jobs.List `json:"completed"` }
StatusResponse is a response from the 'status' endpoint
func (StatusResponse) Print ¶
func (s StatusResponse) Print(out io.Writer)
Print writes out a StatusResponse
func (StatusResponse) Uptime ¶
func (s StatusResponse) Uptime() time.Duration
Uptime will determine the uptime of the daemon