Versions in this module Expand all Collapse all v0 v0.1.0 Nov 12, 2022 v0.0.1 Nov 10, 2022 Changes in this version + var BadRequest = makeErrorResponder(400) + var Conflict = makeErrorResponder(409) + var ErrRestartSocket = fmt.Errorf("daemon stop requested to wait for socket activation") + var Forbidden = makeErrorResponder(403) + var InternalError = makeErrorResponder(500) + var MethodNotAllowed = makeErrorResponder(405) + var NotFound = makeErrorResponder(404) + var NotImplemented = makeErrorResponder(501) + var Unauthorized = makeErrorResponder(401) + func AppNotFound(format string, v ...interface{}) *apiError + func AuthCancelled(format string, v ...interface{}) *apiError + func BadQuery() *apiError + func InsufficientSpace(dserr *snapstate.InsufficientSpaceError) *apiError + func InterfacesUnchanged(format string, v ...interface{}) *apiError + func QuotaChangeConflict(qce *servicestate.QuotaChangeConflictError) *apiError + func SnapChangeConflict(cce *snapstate.ChangeConflictError) *apiError + func SnapNotFound(snapName string, err error) *apiError + func SnapRevisionNotAvailable(snapName string, rnaErr *store.RevisionNotAvailableError) *apiError + type Command struct + GET ResponseFunc + POST ResponseFunc + PUT ResponseFunc + Path string + PathPrefix string + ReadAccess accessChecker + WriteAccess accessChecker + func (c *Command) ServeHTTP(w http.ResponseWriter, r *http.Request) + type Daemon struct + Version string + func New() (*Daemon, error) + func (d *Daemon) Dying() <-chan struct{} + func (d *Daemon) HandleRestart(t restart.RestartType, rebootInfo *boot.RebootInfo) + func (d *Daemon) Init() error + func (d *Daemon) RebootAsExpected(st *state.State) error + func (d *Daemon) RebootDidNotHappen(st *state.State) error + func (d *Daemon) SetDegradedMode(err error) + func (d *Daemon) Start() error + func (d *Daemon) Stop(sigCh chan<- os.Signal) error + type FileReference struct + Filename string + TmpPath string + type Form struct + FileRefs map[string][]*FileReference + Values map[string][]string + func (f *Form) GetSnapFiles() ([]*uploadedSnap, *apiError) + func (f *Form) RemoveAllExcept(paths []string) + type Response interface + ServeHTTP func(w http.ResponseWriter, r *http.Request) + func AssertResponse(asserts []asserts.Assertion, bundle bool) Response + func AsyncResponse(result map[string]interface{}, change string) Response + func SyncResponse(result interface{}) Response + type ResponseFunc func(*Command, *http.Request, *auth.UserState) Response + type ResponseType string + const ResponseTypeAsync + const ResponseTypeError + const ResponseTypeSync + type StructuredResponse interface + JSON func() *respJSON