Documentation ¶
Overview ¶
Package server implements Kopia API server handlers.
Index ¶
- func AssetFile() http.FileSystem
- type Options
- type Server
- func (s *Server) APIHandlers(legacyAPI bool) http.Handler
- func (s *Server) GRPCRouterHandler(handler http.Handler) http.Handler
- func (s *Server) Refresh(ctx context.Context) error
- func (s *Server) RegisterGRPCHandlers(r grpc.ServiceRegistrar)
- func (s *Server) RequireUIUserAuth(hf http.Handler) http.Handler
- func (s *Server) Session(srv grpcapi.KopiaRepository_SessionServer) error
- func (s *Server) SetRepository(ctx context.Context, rep repo.Repository) error
- func (s *Server) StopAllSourceManagers(ctx context.Context)
- func (s *Server) SyncSources(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetFile ¶ added in v0.4.0
func AssetFile() http.FileSystem
AssetFile return a http.FileSystem instance that data backend by asset.
Types ¶
type Options ¶ added in v0.5.2
type Options struct { ConfigFile string ConnectOptions *repo.ConnectOptions RefreshInterval time.Duration MaxConcurrency int Authenticator auth.Authenticator Authorizer auth.Authorizer PasswordPersist passwordpersist.Strategy AuthCookieSigningKey string LogRequests bool UIUser string // name of the user allowed to access the UI }
Options encompasses all API server options.
type Server ¶
type Server struct { OnShutdown func(ctx context.Context) error // contains filtered or unexported fields }
Server exposes simple HTTP API for programmatically accessing Kopia features.
func (*Server) APIHandlers ¶
APIHandlers handles API requests.
func (*Server) GRPCRouterHandler ¶ added in v0.8.0
GRPCRouterHandler returns HTTP handler that supports GRPC services and routes non-GRPC calls to the provided handler.
func (*Server) Refresh ¶ added in v0.8.0
Refresh refreshes the state of the server in response to external signal (e.g. SIGHUP).
func (*Server) RegisterGRPCHandlers ¶ added in v0.8.0
func (s *Server) RegisterGRPCHandlers(r grpc.ServiceRegistrar)
RegisterGRPCHandlers registers server gRPC handler.
func (*Server) RequireUIUserAuth ¶ added in v0.8.0
RequireUIUserAuth wraps the provided http.Handler to only allow UI user and return 403 otherwise.
func (*Server) Session ¶ added in v0.8.0
func (s *Server) Session(srv grpcapi.KopiaRepository_SessionServer) error
Session handles GRPC session from a repository client.
func (*Server) SetRepository ¶ added in v0.5.2
SetRepository sets the repository (nil is allowed and indicates server that is not connected to the repository).
func (*Server) StopAllSourceManagers ¶ added in v0.5.2
StopAllSourceManagers causes all source managers to stop.
Source Files ¶
- api_cli.go
- api_content.go
- api_error.go
- api_estimate.go
- api_manifest.go
- api_mount.go
- api_object_get.go
- api_paths.go
- api_policies.go
- api_repo.go
- api_restore.go
- api_snapshots.go
- api_sources.go
- api_tasks.go
- api_user.go
- grpc_session.go
- htmlui_fallback.go
- server.go
- server_authz_checks.go
- source_manager.go