Documentation
¶
Overview ¶
Package pfs is a generated protocol buffer package.
It is generated from these files:
pfs.proto
It has these top-level messages:
Error Repository Commit Path FileInfo Shard CommitInfo Version GetVersionResponse InitRepositoryRequest GetFileRequest MakeDirectoryRequest PutFileRequest ListFilesRequest ListFilesResponse BranchRequest BranchResponse CommitRequest GetCommitInfoRequest GetCommitInfoResponse PullDiffRequest PushDiffRequest
Index ¶
- Variables
- func Errorf(format string, args ...interface{}) error
- func NewError(errorCode ErrorCode, format string, args ...interface{}) error
- func RegisterApiServer(s *grpc.Server, srv ApiServer)
- func RegisterInternalApiServer(s *grpc.Server, srv InternalApiServer)
- func VersionString(version *Version) string
- type ApiClient
- type ApiServer
- type Api_GetFileClient
- type Api_GetFileServer
- type BranchRequest
- type BranchResponse
- type Commit
- type CommitInfo
- type CommitRequest
- type CommitType
- type Error
- type ErrorCode
- type FileInfo
- type FileType
- type GetCommitInfoRequest
- type GetCommitInfoResponse
- type GetFileRequest
- type GetVersionResponse
- type InitRepositoryRequest
- type InternalApiClient
- type InternalApiServer
- type InternalApi_PullDiffClient
- type InternalApi_PullDiffServer
- type ListFilesRequest
- type ListFilesResponse
- type MakeDirectoryRequest
- type Path
- type PullDiffRequest
- type PushDiffRequest
- type PutFileRequest
- type Repository
- type Shard
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDiscoveryNetworkFailure = NewError(ErrorCode_ERROR_CODE_DISCOVERY_NETWORK_FAILURE, "") ErrDiscoveryNotFound = NewError(ErrorCode_ERROR_CODE_DISCOVERY_NOT_FOUND, "") ErrDiscoveryNotDirectory = NewError(ErrorCode_ERROR_CODE_DISCOVERY_NOT_VALUE, "") ErrDiscoveryNotValue = NewError(ErrorCode_ERROR_CODE_DISCOVERY_NOT_VALUE, "") ErrDiscoveryKeyAlreadyExists = NewError(ErrorCode_ERROR_CODE_DISCOVERY_KEY_ALREADY_EXISTS, "") ErrDiscoveryPreconditionNotMet = NewError(ErrorCode_ERROR_CODE_PRECONDITION_NOT_MET, "") )
View Source
var CommitType_name = map[int32]string{
0: "COMMIT_TYPE_NONE",
1: "COMMIT_TYPE_READ",
2: "COMMIT_TYPE_WRITE",
}
View Source
var CommitType_value = map[string]int32{
"COMMIT_TYPE_NONE": 0,
"COMMIT_TYPE_READ": 1,
"COMMIT_TYPE_WRITE": 2,
}
View Source
var ErrorCode_name = map[int32]string{
0: "ERROR_CODE_NONE",
1: "ERROR_CODE_UNKNOWN",
2: "ERROR_CODE_DISCOVERY_NETWORK_FAILURE",
3: "ERROR_CODE_DISCOVERY_NOT_FOUND",
4: "ERROR_CODE_DISCOVERY_NOT_DIRECTORY",
5: "ERROR_CODE_DISCOVERY_NOT_VALUE",
6: "ERROR_CODE_DISCOVERY_KEY_ALREADY_EXISTS",
7: "ERROR_CODE_PRECONDITION_NOT_MET",
}
View Source
var ErrorCode_value = map[string]int32{
"ERROR_CODE_NONE": 0,
"ERROR_CODE_UNKNOWN": 1,
"ERROR_CODE_DISCOVERY_NETWORK_FAILURE": 2,
"ERROR_CODE_DISCOVERY_NOT_FOUND": 3,
"ERROR_CODE_DISCOVERY_NOT_DIRECTORY": 4,
"ERROR_CODE_DISCOVERY_NOT_VALUE": 5,
"ERROR_CODE_DISCOVERY_KEY_ALREADY_EXISTS": 6,
"ERROR_CODE_PRECONDITION_NOT_MET": 7,
}
View Source
var FileType_name = map[int32]string{
0: "FILE_TYPE_NONE",
1: "FILE_TYPE_OTHER",
2: "FILE_TYPE_REGULAR",
3: "FILE_TYPE_DIR",
}
View Source
var FileType_value = map[string]int32{
"FILE_TYPE_NONE": 0,
"FILE_TYPE_OTHER": 1,
"FILE_TYPE_REGULAR": 2,
"FILE_TYPE_DIR": 3,
}
Functions ¶
func RegisterApiServer ¶
func RegisterInternalApiServer ¶
func RegisterInternalApiServer(s *grpc.Server, srv InternalApiServer)
func VersionString ¶
Types ¶
type ApiClient ¶
type ApiClient interface {
GetVersion(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*GetVersionResponse, error)
// InitRepository creates a new repository.
// An error is returned if the specified repository already exists.
InitRepository(ctx context.Context, in *InitRepositoryRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// GetFile returns a byte stream of the specified file.
// An error is returned if the specified commit is a write commit.
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (Api_GetFileClient, error)
// MakeDirectory makes a directory on the file system.
MakeDirectory(ctx context.Context, in *MakeDirectoryRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// PutFile writes the specified file to PFS.
// An error is returned if the specified commit is not a write commit.
PutFile(ctx context.Context, in *PutFileRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// ListFiles lists the files within a directory.
// An error is returned if the specified path is not a directory.
ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
// Branch creates a new write commit from a base commit.
// An error is returned if the base commit is not a read commit.
Branch(ctx context.Context, in *BranchRequest, opts ...grpc.CallOption) (*BranchResponse, error)
// Commit turns the specified write commit into a read commit.
// An error is returned if the specified commit is not a write commit.
Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// GetCommitInfo returns the CommitInfo for a commit.
GetCommitInfo(ctx context.Context, in *GetCommitInfoRequest, opts ...grpc.CallOption) (*GetCommitInfoResponse, error)
}
func NewApiClient ¶
func NewApiClient(cc *grpc.ClientConn) ApiClient
type ApiServer ¶
type ApiServer interface {
GetVersion(context.Context, *google_protobuf.Empty) (*GetVersionResponse, error)
// InitRepository creates a new repository.
// An error is returned if the specified repository already exists.
InitRepository(context.Context, *InitRepositoryRequest) (*google_protobuf.Empty, error)
// GetFile returns a byte stream of the specified file.
// An error is returned if the specified commit is a write commit.
GetFile(*GetFileRequest, Api_GetFileServer) error
// MakeDirectory makes a directory on the file system.
MakeDirectory(context.Context, *MakeDirectoryRequest) (*google_protobuf.Empty, error)
// PutFile writes the specified file to PFS.
// An error is returned if the specified commit is not a write commit.
PutFile(context.Context, *PutFileRequest) (*google_protobuf.Empty, error)
// ListFiles lists the files within a directory.
// An error is returned if the specified path is not a directory.
ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
// Branch creates a new write commit from a base commit.
// An error is returned if the base commit is not a read commit.
Branch(context.Context, *BranchRequest) (*BranchResponse, error)
// Commit turns the specified write commit into a read commit.
// An error is returned if the specified commit is not a write commit.
Commit(context.Context, *CommitRequest) (*google_protobuf.Empty, error)
// GetCommitInfo returns the CommitInfo for a commit.
GetCommitInfo(context.Context, *GetCommitInfoRequest) (*GetCommitInfoResponse, error)
}
type Api_GetFileClient ¶
type Api_GetFileClient interface {
Recv() (*google_protobuf2.BytesValue, error)
grpc.ClientStream
}
type Api_GetFileServer ¶
type Api_GetFileServer interface {
Send(*google_protobuf2.BytesValue) error
grpc.ServerStream
}
type BranchRequest ¶
type BranchRequest struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Redirect bool `protobuf:"varint,2,opt,name=redirect" json:"redirect,omitempty"`
NewCommit *Commit `protobuf:"bytes,3,opt,name=new_commit" json:"new_commit,omitempty"`
}
func (*BranchRequest) GetCommit ¶
func (m *BranchRequest) GetCommit() *Commit
func (*BranchRequest) GetNewCommit ¶
func (m *BranchRequest) GetNewCommit() *Commit
func (*BranchRequest) ProtoMessage ¶
func (*BranchRequest) ProtoMessage()
func (*BranchRequest) Reset ¶
func (m *BranchRequest) Reset()
func (*BranchRequest) String ¶
func (m *BranchRequest) String() string
type BranchResponse ¶
type BranchResponse struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
}
func (*BranchResponse) GetCommit ¶
func (m *BranchResponse) GetCommit() *Commit
func (*BranchResponse) ProtoMessage ¶
func (*BranchResponse) ProtoMessage()
func (*BranchResponse) Reset ¶
func (m *BranchResponse) Reset()
func (*BranchResponse) String ¶
func (m *BranchResponse) String() string
type Commit ¶
type Commit struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"`
}
Commit represents a specific commit in a repository.
func (*Commit) GetRepository ¶
func (m *Commit) GetRepository() *Repository
func (*Commit) ProtoMessage ¶
func (*Commit) ProtoMessage()
type CommitInfo ¶
type CommitInfo struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
CommitType CommitType `protobuf:"varint,2,opt,name=commit_type,enum=pfs.CommitType" json:"commit_type,omitempty"`
ParentCommit *Commit `protobuf:"bytes,3,opt,name=parent_commit" json:"parent_commit,omitempty"`
}
CommitInfo represents information about a commit.
func (*CommitInfo) GetCommit ¶
func (m *CommitInfo) GetCommit() *Commit
func (*CommitInfo) GetParentCommit ¶
func (m *CommitInfo) GetParentCommit() *Commit
func (*CommitInfo) ProtoMessage ¶
func (*CommitInfo) ProtoMessage()
func (*CommitInfo) Reset ¶
func (m *CommitInfo) Reset()
func (*CommitInfo) String ¶
func (m *CommitInfo) String() string
type CommitRequest ¶
type CommitRequest struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Redirect bool `protobuf:"varint,2,opt,name=redirect" json:"redirect,omitempty"`
}
func (*CommitRequest) GetCommit ¶
func (m *CommitRequest) GetCommit() *Commit
func (*CommitRequest) ProtoMessage ¶
func (*CommitRequest) ProtoMessage()
func (*CommitRequest) Reset ¶
func (m *CommitRequest) Reset()
func (*CommitRequest) String ¶
func (m *CommitRequest) String() string
type CommitType ¶
type CommitType int32
CommitType represents the type of commit.
const ( CommitType_COMMIT_TYPE_NONE CommitType = 0 CommitType_COMMIT_TYPE_READ CommitType = 1 CommitType_COMMIT_TYPE_WRITE CommitType = 2 )
func (CommitType) String ¶
func (x CommitType) String() string
type Error ¶
type Error struct {
ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,enum=pfs.ErrorCode" json:"error_code,omitempty"`
Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
type ErrorCode ¶
type ErrorCode int32
const ( ErrorCode_ERROR_CODE_NONE ErrorCode = 0 ErrorCode_ERROR_CODE_UNKNOWN ErrorCode = 1 ErrorCode_ERROR_CODE_DISCOVERY_NETWORK_FAILURE ErrorCode = 2 ErrorCode_ERROR_CODE_DISCOVERY_NOT_FOUND ErrorCode = 3 ErrorCode_ERROR_CODE_DISCOVERY_NOT_DIRECTORY ErrorCode = 4 ErrorCode_ERROR_CODE_DISCOVERY_NOT_VALUE ErrorCode = 5 ErrorCode_ERROR_CODE_DISCOVERY_KEY_ALREADY_EXISTS ErrorCode = 6 ErrorCode_ERROR_CODE_PRECONDITION_NOT_MET ErrorCode = 7 )
func GetErrorCode ¶
type FileInfo ¶
type FileInfo struct {
Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
FileType FileType `protobuf:"varint,2,opt,name=file_type,enum=pfs.FileType" json:"file_type,omitempty"`
SizeBytes uint64 `protobuf:"varint,3,opt,name=size_bytes" json:"size_bytes,omitempty"`
Perm uint32 `protobuf:"varint,4,opt,name=perm" json:"perm,omitempty"`
LastModified *google_protobuf1.Timestamp `protobuf:"bytes,5,opt,name=last_modified" json:"last_modified,omitempty"`
}
FileInfo represents information about a file.
func (*FileInfo) GetLastModified ¶
func (m *FileInfo) GetLastModified() *google_protobuf1.Timestamp
func (*FileInfo) ProtoMessage ¶
func (*FileInfo) ProtoMessage()
type GetCommitInfoRequest ¶
type GetCommitInfoRequest struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
}
func (*GetCommitInfoRequest) GetCommit ¶
func (m *GetCommitInfoRequest) GetCommit() *Commit
func (*GetCommitInfoRequest) ProtoMessage ¶
func (*GetCommitInfoRequest) ProtoMessage()
func (*GetCommitInfoRequest) Reset ¶
func (m *GetCommitInfoRequest) Reset()
func (*GetCommitInfoRequest) String ¶
func (m *GetCommitInfoRequest) String() string
type GetCommitInfoResponse ¶
type GetCommitInfoResponse struct {
CommitInfo *CommitInfo `protobuf:"bytes,1,opt,name=commit_info" json:"commit_info,omitempty"`
}
func (*GetCommitInfoResponse) GetCommitInfo ¶
func (m *GetCommitInfoResponse) GetCommitInfo() *CommitInfo
func (*GetCommitInfoResponse) ProtoMessage ¶
func (*GetCommitInfoResponse) ProtoMessage()
func (*GetCommitInfoResponse) Reset ¶
func (m *GetCommitInfoResponse) Reset()
func (*GetCommitInfoResponse) String ¶
func (m *GetCommitInfoResponse) String() string
type GetFileRequest ¶
type GetFileRequest struct {
Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
}
func (*GetFileRequest) GetPath ¶
func (m *GetFileRequest) GetPath() *Path
func (*GetFileRequest) ProtoMessage ¶
func (*GetFileRequest) ProtoMessage()
func (*GetFileRequest) Reset ¶
func (m *GetFileRequest) Reset()
func (*GetFileRequest) String ¶
func (m *GetFileRequest) String() string
type GetVersionResponse ¶
type GetVersionResponse struct {
Version *Version `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
}
func (*GetVersionResponse) GetVersion ¶
func (m *GetVersionResponse) GetVersion() *Version
func (*GetVersionResponse) ProtoMessage ¶
func (*GetVersionResponse) ProtoMessage()
func (*GetVersionResponse) Reset ¶
func (m *GetVersionResponse) Reset()
func (*GetVersionResponse) String ¶
func (m *GetVersionResponse) String() string
type InitRepositoryRequest ¶
type InitRepositoryRequest struct {
Repository *Repository `protobuf:"bytes,1,opt,name=repository" json:"repository,omitempty"`
Redirect bool `protobuf:"varint,2,opt,name=redirect" json:"redirect,omitempty"`
}
func (*InitRepositoryRequest) GetRepository ¶
func (m *InitRepositoryRequest) GetRepository() *Repository
func (*InitRepositoryRequest) ProtoMessage ¶
func (*InitRepositoryRequest) ProtoMessage()
func (*InitRepositoryRequest) Reset ¶
func (m *InitRepositoryRequest) Reset()
func (*InitRepositoryRequest) String ¶
func (m *InitRepositoryRequest) String() string
type InternalApiClient ¶
type InternalApiClient interface {
// PullDiff pulls a binary stream of the diff from the specified
// commit to the commit's parent.
PullDiff(ctx context.Context, in *PullDiffRequest, opts ...grpc.CallOption) (InternalApi_PullDiffClient, error)
// Push diff pushes a diff from the specified commit.
PushDiff(ctx context.Context, in *PushDiffRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}
func NewInternalApiClient ¶
func NewInternalApiClient(cc *grpc.ClientConn) InternalApiClient
type InternalApiServer ¶
type InternalApiServer interface {
// PullDiff pulls a binary stream of the diff from the specified
// commit to the commit's parent.
PullDiff(*PullDiffRequest, InternalApi_PullDiffServer) error
// Push diff pushes a diff from the specified commit.
PushDiff(context.Context, *PushDiffRequest) (*google_protobuf.Empty, error)
}
type InternalApi_PullDiffClient ¶
type InternalApi_PullDiffClient interface {
Recv() (*google_protobuf2.BytesValue, error)
grpc.ClientStream
}
type InternalApi_PullDiffServer ¶
type InternalApi_PullDiffServer interface {
Send(*google_protobuf2.BytesValue) error
grpc.ServerStream
}
type ListFilesRequest ¶
type ListFilesRequest struct {
Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
Shard *Shard `protobuf:"bytes,2,opt,name=shard" json:"shard,omitempty"`
Redirect bool `protobuf:"varint,3,opt,name=redirect" json:"redirect,omitempty"`
}
func (*ListFilesRequest) GetPath ¶
func (m *ListFilesRequest) GetPath() *Path
func (*ListFilesRequest) GetShard ¶
func (m *ListFilesRequest) GetShard() *Shard
func (*ListFilesRequest) ProtoMessage ¶
func (*ListFilesRequest) ProtoMessage()
func (*ListFilesRequest) Reset ¶
func (m *ListFilesRequest) Reset()
func (*ListFilesRequest) String ¶
func (m *ListFilesRequest) String() string
type ListFilesResponse ¶
type ListFilesResponse struct {
FileInfo []*FileInfo `protobuf:"bytes,1,rep,name=file_info" json:"file_info,omitempty"`
}
func (*ListFilesResponse) GetFileInfo ¶
func (m *ListFilesResponse) GetFileInfo() []*FileInfo
func (*ListFilesResponse) ProtoMessage ¶
func (*ListFilesResponse) ProtoMessage()
func (*ListFilesResponse) Reset ¶
func (m *ListFilesResponse) Reset()
func (*ListFilesResponse) String ¶
func (m *ListFilesResponse) String() string
type MakeDirectoryRequest ¶
type MakeDirectoryRequest struct {
Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
Redirect bool `protobuf:"varint,2,opt,name=redirect" json:"redirect,omitempty"`
}
func (*MakeDirectoryRequest) GetPath ¶
func (m *MakeDirectoryRequest) GetPath() *Path
func (*MakeDirectoryRequest) ProtoMessage ¶
func (*MakeDirectoryRequest) ProtoMessage()
func (*MakeDirectoryRequest) Reset ¶
func (m *MakeDirectoryRequest) Reset()
func (*MakeDirectoryRequest) String ¶
func (m *MakeDirectoryRequest) String() string
type Path ¶
type Path struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Path string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"`
}
Path represents the full path to a file or directory within PFS.
func (*Path) ProtoMessage ¶
func (*Path) ProtoMessage()
type PullDiffRequest ¶
type PullDiffRequest struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Shard uint64 `protobuf:"varint,2,opt,name=shard" json:"shard,omitempty"`
}
func (*PullDiffRequest) GetCommit ¶
func (m *PullDiffRequest) GetCommit() *Commit
func (*PullDiffRequest) ProtoMessage ¶
func (*PullDiffRequest) ProtoMessage()
func (*PullDiffRequest) Reset ¶
func (m *PullDiffRequest) Reset()
func (*PullDiffRequest) String ¶
func (m *PullDiffRequest) String() string
type PushDiffRequest ¶
type PushDiffRequest struct {
Commit *Commit `protobuf:"bytes,1,opt,name=commit" json:"commit,omitempty"`
Shard uint64 `protobuf:"varint,2,opt,name=shard" json:"shard,omitempty"`
Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
}
func (*PushDiffRequest) GetCommit ¶
func (m *PushDiffRequest) GetCommit() *Commit
func (*PushDiffRequest) ProtoMessage ¶
func (*PushDiffRequest) ProtoMessage()
func (*PushDiffRequest) Reset ¶
func (m *PushDiffRequest) Reset()
func (*PushDiffRequest) String ¶
func (m *PushDiffRequest) String() string
type PutFileRequest ¶
type PutFileRequest struct {
Path *Path `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
func (*PutFileRequest) GetPath ¶
func (m *PutFileRequest) GetPath() *Path
func (*PutFileRequest) ProtoMessage ¶
func (*PutFileRequest) ProtoMessage()
func (*PutFileRequest) Reset ¶
func (m *PutFileRequest) Reset()
func (*PutFileRequest) String ¶
func (m *PutFileRequest) String() string
type Repository ¶
type Repository struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
Repository represents a repository.
func (*Repository) ProtoMessage ¶
func (*Repository) ProtoMessage()
func (*Repository) Reset ¶
func (m *Repository) Reset()
func (*Repository) String ¶
func (m *Repository) String() string
type Shard ¶
type Shard struct {
Number uint64 `protobuf:"varint,1,opt,name=number" json:"number,omitempty"`
Modulo uint64 `protobuf:"varint,2,opt,name=modulo" json:"modulo,omitempty"`
}
Shard represents a dynamic shard within PFS. number must always be less than modulo.
func (*Shard) ProtoMessage ¶
func (*Shard) ProtoMessage()
type Version ¶
type Version struct {
Major uint32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
Minor uint32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"`
Micro uint32 `protobuf:"varint,3,opt,name=micro" json:"micro,omitempty"`
Additional string `protobuf:"bytes,4,opt,name=additional" json:"additional,omitempty"`
}
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.