Documentation ¶
Index ¶
- Constants
- type AddKeyRequest
- type ErrorResponse
- type InfoResponse
- type MetadataResponse
- type RepoInfoResponse
- type RepoKeyListItem
- type RepoKeyListResponse
- type Server
- func (s *Server) DeleteRepoKeyHandler(c *gin.Context)
- func (s *Server) DeleteTreeHandler(c *gin.Context)
- func (s *Server) FileHandler(c *gin.Context)
- func (s *Server) GetInfoHandler(c *gin.Context)
- func (s *Server) GetMetadataHandler(c *gin.Context)
- func (s *Server) GetRepoInfoHandler(c *gin.Context)
- func (s *Server) GetRepoKeyHandler(c *gin.Context)
- func (s *Server) GetTreeHandler(c *gin.Context)
- func (s *Server) MiddlewareRequireInfoFileVersion(version uint16) func(c *gin.Context)
- func (s *Server) MiddlewareRequireReadWrite(c *gin.Context)
- func (s *Server) MiddlewareRequireRepo(c *gin.Context)
- func (s *Server) MiddlewareRequireUnlock(c *gin.Context)
- func (s *Server) PostRepoKeyHandler(c *gin.Context)
- func (s *Server) PostRepoSelectHandler(c *gin.Context)
- func (s *Server) PostRepoUnlockHandler(dryRun bool) func(c *gin.Context)
- func (s *Server) PostTreeHandler(c *gin.Context)
- func (s *Server) Start(ctx context.Context, address, port string) error
- type TreeOperationResponse
- type UnlockKeyRequest
Constants ¶
const IdleTimeout = 20
Timeout (in seconds) for detecting idle connections (which are not closed but are hanging)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddKeyRequest ¶ added in v0.5.0
type ErrorResponse ¶ added in v0.5.0
type ErrorResponse struct {
Error string `json:"error"`
}
type InfoResponse ¶ added in v0.5.1
type InfoResponse struct { Name string `json:"name"` AppVersion string `json:"version,omitempty"` BuildID string `json:"buildId,omitempty"` BuildTime string `json:"buildTime,omitempty"` CommitHash string `json:"commitHash,omitempty"` Runtime string `json:"runtime,omitempty"` Info string `json:"info,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` }
type MetadataResponse ¶ added in v0.5.0
type RepoInfoResponse ¶ added in v0.5.1
type RepoKeyListItem ¶ added in v0.5.0
type RepoKeyListResponse ¶ added in v0.5.0
type RepoKeyListResponse struct {
Keys []RepoKeyListItem `json:"keys"`
}
type Server ¶
type Server struct { Store fs.Fs Verbose bool Repo *repository.Repository Infofile *infofile.InfoFile LogWriter io.Writer ReadOnly bool }
func (*Server) DeleteRepoKeyHandler ¶ added in v0.5.0
DeleteRepoKeyHandler is the handler for DELETE /api/repo/key/:keyId, which removes a key key
func (*Server) DeleteTreeHandler ¶ added in v0.3.0
DeleteTreeHandler is the handler for DELETE /api/tree/:path, which removes an object The :path value must be an exact object, or must end with "/*" to remove a folder
func (*Server) FileHandler ¶
FileHandler is the handler for GET /file/:fileId, which returns a (decrypted) file
func (*Server) GetInfoHandler ¶ added in v0.5.0
GetInfoHandler is the handler for GET /api/info, which returns the info for the app
func (*Server) GetMetadataHandler ¶ added in v0.5.0
GetMetadataHandler is the handler for GET /api/metadata/:file, which returns the metadata for a file
func (*Server) GetRepoInfoHandler ¶ added in v0.5.1
GetInfoHandler is the handler for GET /api/repo/info, which returns info about the repository
func (*Server) GetRepoKeyHandler ¶ added in v0.5.0
GetRepoKeyHandler is the handler for GET /api/repo/key, which returns the list of keys allowed to unlock this repository
func (*Server) GetTreeHandler ¶ added in v0.3.0
GetTreeHandler is the handler for GET /api/tree/:path, which returns the contents of a path
func (*Server) MiddlewareRequireInfoFileVersion ¶ added in v0.4.0
MiddlewareRequireInfoFileVersion requires a minimum version of the info file to continue
func (*Server) MiddlewareRequireReadWrite ¶ added in v0.5.1
MiddlewareRequireReadWrite disables a route that would edit the repository if we're operating in read-only mode
func (*Server) MiddlewareRequireRepo ¶ added in v0.5.0
MiddlewareRequireRepo requires a repository to be selected (even if not unlocked)
func (*Server) MiddlewareRequireUnlock ¶ added in v0.5.0
MiddlewareRequireUnlock requires the repository to be unlocked before processing
func (*Server) PostRepoKeyHandler ¶ added in v0.5.0
PostRepoKeyHandler is the handler for POST /api/repo/key, which adds a new key
func (*Server) PostRepoSelectHandler ¶ added in v0.5.0
PostRepoSelectHandler is the handler for POST /api/repo/select, which selects a repository
func (*Server) PostRepoUnlockHandler ¶ added in v0.5.0
PostRepoUnlockHandler is the handler for POST /api/repo/unlock, which unlocks a repository The same handler is also used by POST /api/repo/keytest, which tests a key and returns its ID (essentially performing a "dry run" for the unlock operation)
func (*Server) PostTreeHandler ¶ added in v0.3.0
PostTreeHandler is the handler for POST /api/tree/:path, which adds documents to the repository The path argument is the destination folder (just like the "-d" argument in the "prvt add" command) The post body can contain either one of: - One or more files transmitted in the request body, in the "file" field(s) - The path to a file or folder in the local filesystem, in the "localpath" field(s)