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) 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.AuthorizerFunc AuthCookieSigningKey string 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) 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.