acb

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMaskedToClient    = errors.New("")
	ErrSaveDisabled      = fmt.Errorf("%wsave disabled", ErrMaskedToClient)
	ErrDeleteDisabled    = fmt.Errorf("%wdelete disabled", ErrMaskedToClient)
	ErrDeleteForbidden   = fmt.Errorf("%wdelete forbidden", ErrMaskedToClient)
	ErrNewDeviceDisabled = fmt.Errorf("%wnew devices disabled", ErrMaskedToClient)
)

Functions

func UserAgentMiddleware

func UserAgentMiddleware(c *gin.Context)

Types

type DirectoryStore

type DirectoryStore struct {
	// contains filtered or unexported fields
}

func NewDirectoryStore

func NewDirectoryStore(path string, logger *log.Entry) (*DirectoryStore, error)

func (*DirectoryStore) DeleteRevision added in v1.1.0

func (d *DirectoryStore) DeleteRevision(device string, revisionId string, features config.Features) error

func (*DirectoryStore) GetRevision

func (d *DirectoryStore) GetRevision(device string, revisionId string, features config.Features) (*entity.Revision, error)

func (*DirectoryStore) GetRevisionsForDevice

func (d *DirectoryStore) GetRevisionsForDevice(device string, features config.Features) (entity.RevisionList, error)

func (*DirectoryStore) SetRevision

func (d *DirectoryStore) SetRevision(revision *entity.Revision, features config.Features) error

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(log *logrus.Entry, store Store, config *config2.Config) (*Server, error)

func (*Server) Configure

func (s *Server) Configure() error

func (*Server) DeleteBackupHandler added in v1.1.0

func (s *Server) DeleteBackupHandler(c *gin.Context)

func (*Server) ListBackupsHandler

func (s *Server) ListBackupsHandler(c *gin.Context)

ListBackupsHandler implements the ACB /getbkp

func (*Server) Ping

func (s *Server) Ping(c *gin.Context)

func (*Server) SaveBackupHandler

func (s *Server) SaveBackupHandler(c *gin.Context)

$post_fields = array(

	'reason' => htmlspecialchars($reason),
	'uid' => $uniqueID,
	'file' => curl_file_create($tmpname, 'image/jpg', 'config.jpg'),
	'userkey' => htmlspecialchars($userkey),
	'sha256_hash' => $raw_config_sha256_hash,
	'version' => $g['product_version'],
	'hint' => $config['system']['acb']['hint'],
	'manmax' => $manmax
);

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(entry *log.Entry, config *ServiceConfig) (*Service, error)

func (*Service) Configure

func (s *Service) Configure() error

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop() error

type ServiceConfig

type ServiceConfig struct {
	Store           StoreType       `yaml:"store" validate:"required" default:"directory"`
	Path            string          `yaml:"path" validate:"required"`
	Servers         []config.Config `yaml:"servers"`
	*logging.Config `yaml:"logging"`
}

func (*ServiceConfig) Check

func (c *ServiceConfig) Check() error

type Store

type Store interface {
	GetRevisionsForDevice(device string, features config.Features) (entity.RevisionList, error)
	GetRevision(device string, revisionId string, features config.Features) (*entity.Revision, error)
	DeleteRevision(device string, revisionId string, features config.Features) error
	SetRevision(revision *entity.Revision, features config.Features) error
}

type StoreType

type StoreType string
const DirectoryStoreType StoreType = "directory"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL