Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateAddTableFilesRequest(req *remotesapi.AddTableFilesRequest) error
- func ValidateCommitRequest(req *remotesapi.CommitRequest) error
- func ValidateGetDownloadLocsRequest(req *remotesapi.GetDownloadLocsRequest) error
- func ValidateGetRepoMetadataRequest(req *remotesapi.GetRepoMetadataRequest) error
- func ValidateGetUploadLocsRequest(req *remotesapi.GetUploadLocsRequest) error
- func ValidateHasChunksRequest(req *remotesapi.HasChunksRequest) error
- func ValidateListTableFilesRequest(req *remotesapi.ListTableFilesRequest) error
- func ValidateRebaseRequest(req *remotesapi.RebaseRequest) error
- func ValidateRefreshTableFileUrlRequest(req *remotesapi.RefreshTableFileUrlRequest) error
- func ValidateRootRequest(req *remotesapi.RootRequest) error
- type AccessControl
- type DBCache
- type Listeners
- type ReadOnlyChunkStore
- func (rs ReadOnlyChunkStore) AddTableFiles(ctx context.Context, req *remotesapi.AddTableFilesRequest) (*remotesapi.AddTableFilesResponse, error)
- func (rs ReadOnlyChunkStore) Commit(ctx context.Context, req *remotesapi.CommitRequest) (*remotesapi.CommitResponse, error)
- func (rs ReadOnlyChunkStore) GetUploadLocations(ctx context.Context, req *remotesapi.GetUploadLocsRequest) (*remotesapi.GetUploadLocsResponse, error)
- type RemoteChunkStore
- func (rs *RemoteChunkStore) AddTableFiles(ctx context.Context, req *remotesapi.AddTableFilesRequest) (*remotesapi.AddTableFilesResponse, error)
- func (rs *RemoteChunkStore) Commit(ctx context.Context, req *remotesapi.CommitRequest) (*remotesapi.CommitResponse, error)
- func (rs *RemoteChunkStore) GetDownloadLocations(ctx context.Context, req *remotesapi.GetDownloadLocsRequest) (*remotesapi.GetDownloadLocsResponse, error)
- func (rs *RemoteChunkStore) GetRepoMetadata(ctx context.Context, req *remotesapi.GetRepoMetadataRequest) (*remotesapi.GetRepoMetadataResponse, error)
- func (rs *RemoteChunkStore) GetUploadLocations(ctx context.Context, req *remotesapi.GetUploadLocsRequest) (*remotesapi.GetUploadLocsResponse, error)
- func (rs *RemoteChunkStore) HasChunks(ctx context.Context, req *remotesapi.HasChunksRequest) (*remotesapi.HasChunksResponse, error)
- func (rs *RemoteChunkStore) ListTableFiles(ctx context.Context, req *remotesapi.ListTableFilesRequest) (*remotesapi.ListTableFilesResponse, error)
- func (rs *RemoteChunkStore) Rebase(ctx context.Context, req *remotesapi.RebaseRequest) (*remotesapi.RebaseResponse, error)
- func (rs *RemoteChunkStore) Root(ctx context.Context, req *remotesapi.RootRequest) (*remotesapi.RootResponse, error)
- func (rs *RemoteChunkStore) StreamDownloadLocations(stream remotesapi.ChunkStoreService_StreamDownloadLocationsServer) error
- type RemoteSrvStore
- type RequestCredentials
- type Sealer
- type Server
- type ServerArgs
- type ServerInterceptor
Constants ¶
View Source
const RepoPathField = "repo_path"
Variables ¶
View Source
var CLONE_ADMIN_RPC_METHODS = map[string]bool{ "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/GetDownloadLocations": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/GetRepoMetadata": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/HasChunks": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/ListTableFiles": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/RefreshTableFileUrl": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/Root": true, "/dolt.services.remotesapi.v1alpha1.ChunkStoreService/StreamDownloadLocations": true, }
View Source
var (
ErrReadOutOfBounds = errors.New("cannot read file for given length and " +
"offset since the read would exceed the size of the file")
)
View Source
var ErrUnimplemented = errors.New("unimplemented")
Functions ¶
func ValidateAddTableFilesRequest ¶
func ValidateAddTableFilesRequest(req *remotesapi.AddTableFilesRequest) error
func ValidateCommitRequest ¶
func ValidateCommitRequest(req *remotesapi.CommitRequest) error
func ValidateGetDownloadLocsRequest ¶
func ValidateGetDownloadLocsRequest(req *remotesapi.GetDownloadLocsRequest) error
func ValidateGetRepoMetadataRequest ¶
func ValidateGetRepoMetadataRequest(req *remotesapi.GetRepoMetadataRequest) error
func ValidateGetUploadLocsRequest ¶
func ValidateGetUploadLocsRequest(req *remotesapi.GetUploadLocsRequest) error
func ValidateHasChunksRequest ¶
func ValidateHasChunksRequest(req *remotesapi.HasChunksRequest) error
func ValidateListTableFilesRequest ¶
func ValidateListTableFilesRequest(req *remotesapi.ListTableFilesRequest) error
func ValidateRebaseRequest ¶
func ValidateRebaseRequest(req *remotesapi.RebaseRequest) error
func ValidateRefreshTableFileUrlRequest ¶
func ValidateRefreshTableFileUrlRequest(req *remotesapi.RefreshTableFileUrlRequest) error
func ValidateRootRequest ¶
func ValidateRootRequest(req *remotesapi.RootRequest) error
Types ¶
type AccessControl ¶
type AccessControl interface { // ApiAuthenticate checks the incoming request for authentication credentials and validates them. If the user's // identity checks out, the returned context will have the sqlContext within it, which contains the user's ID. // If the user is not legitimate, an error is returned. ApiAuthenticate(ctx context.Context) (context.Context, error) // ApiAuthorize checks that the authenticated user has sufficient privileges to perform the requested action. // Currently, our resource policy is binary currently, a user either is a SuperUser (form Commit) or they have a // CLONE_ADMIN grant for read operations. // More resource aware authorization decisions will be needed in the future, but this is sufficient for now. ApiAuthorize(ctx context.Context, superUserReq bool) (bool, error) }
AccessControl is an interface that provides authentication and authorization for the gRPC server.
type DBCache ¶
type DBCache interface {
Get(ctx context.Context, path, nbfVerStr string) (RemoteSrvStore, error)
}
type ReadOnlyChunkStore ¶
type ReadOnlyChunkStore struct {
remotesapi.ChunkStoreServiceServer
}
func (ReadOnlyChunkStore) AddTableFiles ¶
func (rs ReadOnlyChunkStore) AddTableFiles(ctx context.Context, req *remotesapi.AddTableFilesRequest) (*remotesapi.AddTableFilesResponse, error)
func (ReadOnlyChunkStore) Commit ¶
func (rs ReadOnlyChunkStore) Commit(ctx context.Context, req *remotesapi.CommitRequest) (*remotesapi.CommitResponse, error)
func (ReadOnlyChunkStore) GetUploadLocations ¶
func (rs ReadOnlyChunkStore) GetUploadLocations(ctx context.Context, req *remotesapi.GetUploadLocsRequest) (*remotesapi.GetUploadLocsResponse, error)
type RemoteChunkStore ¶
type RemoteChunkStore struct { HttpHost string remotesapi.UnimplementedChunkStoreServiceServer // contains filtered or unexported fields }
func NewHttpFSBackedChunkStore ¶
func NewHttpFSBackedChunkStore(lgr *logrus.Entry, httpHost string, csCache DBCache, fs filesys.Filesys, scheme string, concurrencyControl remotesapi.PushConcurrencyControl, sealer Sealer) *RemoteChunkStore
func (*RemoteChunkStore) AddTableFiles ¶
func (rs *RemoteChunkStore) AddTableFiles(ctx context.Context, req *remotesapi.AddTableFilesRequest) (*remotesapi.AddTableFilesResponse, error)
AddTableFiles updates the remote manifest with new table files without modifying the root hash.
func (*RemoteChunkStore) Commit ¶
func (rs *RemoteChunkStore) Commit(ctx context.Context, req *remotesapi.CommitRequest) (*remotesapi.CommitResponse, error)
func (*RemoteChunkStore) GetDownloadLocations ¶
func (rs *RemoteChunkStore) GetDownloadLocations(ctx context.Context, req *remotesapi.GetDownloadLocsRequest) (*remotesapi.GetDownloadLocsResponse, error)
func (*RemoteChunkStore) GetRepoMetadata ¶
func (rs *RemoteChunkStore) GetRepoMetadata(ctx context.Context, req *remotesapi.GetRepoMetadataRequest) (*remotesapi.GetRepoMetadataResponse, error)
func (*RemoteChunkStore) GetUploadLocations ¶
func (rs *RemoteChunkStore) GetUploadLocations(ctx context.Context, req *remotesapi.GetUploadLocsRequest) (*remotesapi.GetUploadLocsResponse, error)
func (*RemoteChunkStore) HasChunks ¶
func (rs *RemoteChunkStore) HasChunks(ctx context.Context, req *remotesapi.HasChunksRequest) (*remotesapi.HasChunksResponse, error)
func (*RemoteChunkStore) ListTableFiles ¶
func (rs *RemoteChunkStore) ListTableFiles(ctx context.Context, req *remotesapi.ListTableFilesRequest) (*remotesapi.ListTableFilesResponse, error)
func (*RemoteChunkStore) Rebase ¶
func (rs *RemoteChunkStore) Rebase(ctx context.Context, req *remotesapi.RebaseRequest) (*remotesapi.RebaseResponse, error)
func (*RemoteChunkStore) Root ¶
func (rs *RemoteChunkStore) Root(ctx context.Context, req *remotesapi.RootRequest) (*remotesapi.RootResponse, error)
func (*RemoteChunkStore) StreamDownloadLocations ¶
func (rs *RemoteChunkStore) StreamDownloadLocations(stream remotesapi.ChunkStoreService_StreamDownloadLocationsServer) error
type RemoteSrvStore ¶
type RequestCredentials ¶
func ExtractBasicAuthCreds ¶
func ExtractBasicAuthCreds(ctx context.Context) (*RequestCredentials, error)
ExtractBasicAuthCreds extracts the username and password from the incoming request. It returns RequestCredentials populated with necessary information to authenticate the request. nil and an error will be returned if any error occurs.
type Sealer ¶
Interface to seal requests to the HTTP server so that they cannot be forged. The gRPC server seals URLs and the HTTP server unseals them.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(args ServerArgs) (*Server, error)
func (*Server) GracefulStop ¶
func (s *Server) GracefulStop()
func (*Server) GrpcServer ¶
Can be used to register more services on the server. Should only be accessed before `Serve` is called.
type ServerArgs ¶
type ServerArgs struct { Logger *logrus.Entry HttpHost string HttpListenAddr string GrpcListenAddr string FS filesys.Filesys DBCache DBCache ReadOnly bool Options []grpc.ServerOption ConcurrencyControl remotesapi.PushConcurrencyControl HttpInterceptor func(http.Handler) http.Handler // If supplied, the listener(s) returned from Listeners() will be TLS // listeners. The scheme used in the URLs returned from the gRPC server // will be https. TLSConfig *tls.Config }
type ServerInterceptor ¶
type ServerInterceptor struct { Lgr *logrus.Entry AccessController AccessControl }
func (*ServerInterceptor) Options ¶
func (si *ServerInterceptor) Options() []grpc.ServerOption
func (*ServerInterceptor) Stream ¶
func (si *ServerInterceptor) Stream() grpc.StreamServerInterceptor
func (*ServerInterceptor) Unary ¶
func (si *ServerInterceptor) Unary() grpc.UnaryServerInterceptor
Click to show internal directories.
Click to hide internal directories.