Documentation ¶
Overview ¶
Package gitiles contains Gitiles service definition.
NOTE: The Gitiles API is an HTTP REST API. Gitiles does not have gRPC or pRPC APIs. The bindings in this file are provided for convenience.
Index ¶
- Constants
- Variables
- func FileDescriptorSet() *descriptorpb.FileDescriptorSet
- func MakeFakeCommits(rng *rand.Rand, n int, parents []string) (ret []*git.Commit)
- func RegisterGitilesServer(s prpc.Registrar, srv GitilesServer)
- type ArchiveRequest
- func (*ArchiveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ArchiveRequest) GetFormat() ArchiveRequest_Format
- func (x *ArchiveRequest) GetPath() string
- func (x *ArchiveRequest) GetProject() string
- func (x *ArchiveRequest) GetRef() string
- func (*ArchiveRequest) ProtoMessage()
- func (x *ArchiveRequest) ProtoReflect() protoreflect.Message
- func (x *ArchiveRequest) Reset()
- func (x *ArchiveRequest) String() string
- func (r *ArchiveRequest) Validate() error
- type ArchiveRequest_Format
- func (ArchiveRequest_Format) Descriptor() protoreflect.EnumDescriptor
- func (x ArchiveRequest_Format) Enum() *ArchiveRequest_Format
- func (ArchiveRequest_Format) EnumDescriptor() ([]byte, []int)deprecated
- func (x ArchiveRequest_Format) Number() protoreflect.EnumNumber
- func (x ArchiveRequest_Format) String() string
- func (ArchiveRequest_Format) Type() protoreflect.EnumType
- type ArchiveResponse
- func (*ArchiveResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ArchiveResponse) GetContents() []byte
- func (x *ArchiveResponse) GetFilename() string
- func (*ArchiveResponse) ProtoMessage()
- func (x *ArchiveResponse) ProtoReflect() protoreflect.Message
- func (x *ArchiveResponse) Reset()
- func (x *ArchiveResponse) String() string
- type DownloadDiffRequest
- func (*DownloadDiffRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadDiffRequest) GetBase() string
- func (x *DownloadDiffRequest) GetCommittish() string
- func (x *DownloadDiffRequest) GetPath() string
- func (x *DownloadDiffRequest) GetProject() string
- func (*DownloadDiffRequest) ProtoMessage()
- func (x *DownloadDiffRequest) ProtoReflect() protoreflect.Message
- func (x *DownloadDiffRequest) Reset()
- func (x *DownloadDiffRequest) String() string
- func (r *DownloadDiffRequest) Validate() error
- type DownloadDiffResponse
- func (*DownloadDiffResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadDiffResponse) GetContents() string
- func (*DownloadDiffResponse) ProtoMessage()
- func (x *DownloadDiffResponse) ProtoReflect() protoreflect.Message
- func (x *DownloadDiffResponse) Reset()
- func (x *DownloadDiffResponse) String() string
- type DownloadFileRequest
- func (*DownloadFileRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadFileRequest) GetCommittish() string
- func (x *DownloadFileRequest) GetFormat() DownloadFileRequest_Format
- func (x *DownloadFileRequest) GetPath() string
- func (x *DownloadFileRequest) GetProject() string
- func (*DownloadFileRequest) ProtoMessage()
- func (x *DownloadFileRequest) ProtoReflect() protoreflect.Message
- func (x *DownloadFileRequest) Reset()
- func (x *DownloadFileRequest) String() string
- func (r *DownloadFileRequest) Validate() error
- type DownloadFileRequest_Format
- func (DownloadFileRequest_Format) Descriptor() protoreflect.EnumDescriptor
- func (x DownloadFileRequest_Format) Enum() *DownloadFileRequest_Format
- func (DownloadFileRequest_Format) EnumDescriptor() ([]byte, []int)deprecated
- func (x DownloadFileRequest_Format) Number() protoreflect.EnumNumber
- func (x DownloadFileRequest_Format) String() string
- func (DownloadFileRequest_Format) Type() protoreflect.EnumType
- type DownloadFileResponse
- func (*DownloadFileResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadFileResponse) GetContents() string
- func (*DownloadFileResponse) ProtoMessage()
- func (x *DownloadFileResponse) ProtoReflect() protoreflect.Message
- func (x *DownloadFileResponse) Reset()
- func (x *DownloadFileResponse) String() string
- type Fake
- func (f *Fake) Archive(ctx context.Context, in *ArchiveRequest, opts ...grpc.CallOption) (*ArchiveResponse, error)
- func (f *Fake) DownloadDiff(ctx context.Context, in *DownloadDiffRequest, opts ...grpc.CallOption) (*DownloadDiffResponse, error)
- func (f *Fake) DownloadFile(ctx context.Context, in *DownloadFileRequest, opts ...grpc.CallOption) (*DownloadFileResponse, error)
- func (f *Fake) GetCallLogs() []any
- func (f *Fake) GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*Project, error)
- func (f *Fake) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
- func (f *Fake) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error)
- func (f *Fake) Projects(ctx context.Context, in *ProjectsRequest, opts ...grpc.CallOption) (*ProjectsResponse, error)
- func (f *Fake) Refs(ctx context.Context, in *RefsRequest, opts ...grpc.CallOption) (*RefsResponse, error)
- func (f *Fake) SetRepository(repository string, refs map[string]string, commits []*git.Commit)
- type GetProjectRequest
- type GitilesClient
- type GitilesServer
- type ListFilesRequest
- func (*ListFilesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListFilesRequest) GetCommittish() string
- func (x *ListFilesRequest) GetPath() string
- func (x *ListFilesRequest) GetProject() string
- func (*ListFilesRequest) ProtoMessage()
- func (x *ListFilesRequest) ProtoReflect() protoreflect.Message
- func (x *ListFilesRequest) Reset()
- func (x *ListFilesRequest) String() string
- func (r *ListFilesRequest) Validate() error
- type ListFilesResponse
- func (*ListFilesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListFilesResponse) GetFiles() []*git.File
- func (*ListFilesResponse) ProtoMessage()
- func (x *ListFilesResponse) ProtoReflect() protoreflect.Message
- func (x *ListFilesResponse) Reset()
- func (x *ListFilesResponse) String() string
- type LogRequest
- func (*LogRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LogRequest) GetCommittish() string
- func (x *LogRequest) GetExcludeAncestorsOf() string
- func (x *LogRequest) GetPageSize() int32
- func (x *LogRequest) GetPageToken() string
- func (x *LogRequest) GetPath() string
- func (x *LogRequest) GetProject() string
- func (x *LogRequest) GetTreeDiff() bool
- func (*LogRequest) ProtoMessage()
- func (x *LogRequest) ProtoReflect() protoreflect.Message
- func (x *LogRequest) Reset()
- func (x *LogRequest) String() string
- func (r *LogRequest) Validate() error
- type LogResponse
- func (*LogResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LogResponse) GetLog() []*git.Commit
- func (x *LogResponse) GetNextPageToken() string
- func (*LogResponse) ProtoMessage()
- func (x *LogResponse) ProtoReflect() protoreflect.Message
- func (x *LogResponse) Reset()
- func (x *LogResponse) String() string
- type Project
- type ProjectsRequest
- type ProjectsResponse
- type RefsRequest
- func (*RefsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RefsRequest) GetProject() string
- func (x *RefsRequest) GetRefsPath() string
- func (*RefsRequest) ProtoMessage()
- func (x *RefsRequest) ProtoReflect() protoreflect.Message
- func (x *RefsRequest) Reset()
- func (x *RefsRequest) String() string
- func (r *RefsRequest) Validate() error
- type RefsResponse
- type UnimplementedGitilesServer
- func (*UnimplementedGitilesServer) Archive(context.Context, *ArchiveRequest) (*ArchiveResponse, error)
- func (*UnimplementedGitilesServer) DownloadDiff(context.Context, *DownloadDiffRequest) (*DownloadDiffResponse, error)
- func (*UnimplementedGitilesServer) DownloadFile(context.Context, *DownloadFileRequest) (*DownloadFileResponse, error)
- func (*UnimplementedGitilesServer) GetProject(context.Context, *GetProjectRequest) (*Project, error)
- func (*UnimplementedGitilesServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
- func (*UnimplementedGitilesServer) Log(context.Context, *LogRequest) (*LogResponse, error)
- func (*UnimplementedGitilesServer) Projects(context.Context, *ProjectsRequest) (*ProjectsResponse, error)
- func (*UnimplementedGitilesServer) Refs(context.Context, *RefsRequest) (*RefsResponse, error)
Constants ¶
const ( // AllRefs instructs the client to fetch all refs. AllRefs = "refs" // Branches instructs the client to fetch all branches. Branches = "refs/heads" // Tags instructs the client to fetch all tags. Tags = "refs/tags" )
These constants are possible values for RefsRequest.RefsPath field. Not an exhaustive list.
Variables ¶
var ( ArchiveRequest_Format_name = map[int32]string{ 0: "Invalid", 1: "GZIP", 2: "TAR", 3: "BZIP2", 4: "XZ", } ArchiveRequest_Format_value = map[string]int32{ "Invalid": 0, "GZIP": 1, "TAR": 2, "BZIP2": 3, "XZ": 4, } )
Enum value maps for ArchiveRequest_Format.
var ( DownloadFileRequest_Format_name = map[int32]string{ 0: "FORMAT_INVALID", 1: "TEXT", 2: "JSON", } DownloadFileRequest_Format_value = map[string]int32{ "FORMAT_INVALID": 0, "TEXT": 1, "JSON": 2, } )
Enum value maps for DownloadFileRequest_Format.
var File_go_chromium_org_luci_common_proto_gitiles_gitiles_proto protoreflect.FileDescriptor
Functions ¶
func FileDescriptorSet ¶
func FileDescriptorSet() *descriptorpb.FileDescriptorSet
FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.
Will not return nil.
Do NOT modify the returned descriptor.
func MakeFakeCommits ¶
MakeFakeCommits returns a list of chained commits with randomly generated ID.
The commits have the following relationship: ret[0] -> ret[1] -> ... -> ret[n-1] -> parents
This can be used to create a chain of fake commits to be passed to Fake.SetRepository.
Take a `*rand.Rand` instead of a seed so that the caller can use the same seed to create multiple commit chains and combine them into a more complex tree. It's recommended to seed the `*rand.Rand` so the tests are deterministic.
func RegisterGitilesServer ¶
func RegisterGitilesServer(s prpc.Registrar, srv GitilesServer)
Types ¶
type ArchiveRequest ¶
type ArchiveRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // The ref at which to generate the project archive for. // // viz refs/for/branch or just branch Ref string `protobuf:"bytes,2,opt,name=ref,proto3" json:"ref,omitempty"` // Format of the returned archive. Format ArchiveRequest_Format `protobuf:"varint,3,opt,name=format,proto3,enum=gitiles.ArchiveRequest_Format" json:"format,omitempty"` // POSIX style path relative to the project root. // Optional. If not specified, it means to get the entire project archive. Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
ArchiveRequest is a request message of the Gitiles.Archive RPC.
func (*ArchiveRequest) Descriptor
deprecated
func (*ArchiveRequest) Descriptor() ([]byte, []int)
Deprecated: Use ArchiveRequest.ProtoReflect.Descriptor instead.
func (*ArchiveRequest) GetFormat ¶
func (x *ArchiveRequest) GetFormat() ArchiveRequest_Format
func (*ArchiveRequest) GetPath ¶
func (x *ArchiveRequest) GetPath() string
func (*ArchiveRequest) GetProject ¶
func (x *ArchiveRequest) GetProject() string
func (*ArchiveRequest) GetRef ¶
func (x *ArchiveRequest) GetRef() string
func (*ArchiveRequest) ProtoMessage ¶
func (*ArchiveRequest) ProtoMessage()
func (*ArchiveRequest) ProtoReflect ¶
func (x *ArchiveRequest) ProtoReflect() protoreflect.Message
func (*ArchiveRequest) Reset ¶
func (x *ArchiveRequest) Reset()
func (*ArchiveRequest) String ¶
func (x *ArchiveRequest) String() string
func (*ArchiveRequest) Validate ¶
func (r *ArchiveRequest) Validate() error
Validate returns an error if r is invalid.
type ArchiveRequest_Format ¶
type ArchiveRequest_Format int32
List copied from https://github.com/google/gitiles/blob/65edbe49f2b3882a5979f602383ef0c7b2b8ee0c/java/com/google/gitiles/ArchiveFormat.java
const ( ArchiveRequest_Invalid ArchiveRequest_Format = 0 ArchiveRequest_GZIP ArchiveRequest_Format = 1 ArchiveRequest_TAR ArchiveRequest_Format = 2 ArchiveRequest_BZIP2 ArchiveRequest_Format = 3 ArchiveRequest_XZ ArchiveRequest_Format = 4 )
func (ArchiveRequest_Format) Descriptor ¶
func (ArchiveRequest_Format) Descriptor() protoreflect.EnumDescriptor
func (ArchiveRequest_Format) Enum ¶
func (x ArchiveRequest_Format) Enum() *ArchiveRequest_Format
func (ArchiveRequest_Format) EnumDescriptor
deprecated
func (ArchiveRequest_Format) EnumDescriptor() ([]byte, []int)
Deprecated: Use ArchiveRequest_Format.Descriptor instead.
func (ArchiveRequest_Format) Number ¶
func (x ArchiveRequest_Format) Number() protoreflect.EnumNumber
func (ArchiveRequest_Format) String ¶
func (x ArchiveRequest_Format) String() string
func (ArchiveRequest_Format) Type ¶
func (ArchiveRequest_Format) Type() protoreflect.EnumType
type ArchiveResponse ¶
type ArchiveResponse struct { // Suggested name of the returned archive. Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // Contents of the archive streamed from gitiles. // // The underlying server RPC streams back the contents. This API simplifies // the RPC to a non-streaming response. Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"` // contains filtered or unexported fields }
func (*ArchiveResponse) Descriptor
deprecated
func (*ArchiveResponse) Descriptor() ([]byte, []int)
Deprecated: Use ArchiveResponse.ProtoReflect.Descriptor instead.
func (*ArchiveResponse) GetContents ¶
func (x *ArchiveResponse) GetContents() []byte
func (*ArchiveResponse) GetFilename ¶
func (x *ArchiveResponse) GetFilename() string
func (*ArchiveResponse) ProtoMessage ¶
func (*ArchiveResponse) ProtoMessage()
func (*ArchiveResponse) ProtoReflect ¶
func (x *ArchiveResponse) ProtoReflect() protoreflect.Message
func (*ArchiveResponse) Reset ¶
func (x *ArchiveResponse) Reset()
func (*ArchiveResponse) String ¶
func (x *ArchiveResponse) String() string
type DownloadDiffRequest ¶
type DownloadDiffRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // The git revision to get the diff at. // The value can be: // - a git revision as 40-char string or its prefix so long as its unique in repo. // - a ref such as "refs/heads/branch" // - a ref defined as n-th parent of R in the form "R~n". // For example, "main~2" or "deadbeef~1". // // Required. Committish string `protobuf:"bytes,2,opt,name=committish,proto3" json:"committish,omitempty"` // The git revision to compute the diff against. // The value can be: // - a git revision as 40-char string or its prefix so long as its unique in repo. // - a ref such as "refs/heads/branch" // - a ref defined as n-th parent of R in the form "R~n". // For example, "main~2" or "deadbeef~1". // // Optional. If not specified, the diff will be against the parent of committish. Base string `protobuf:"bytes,4,opt,name=base,proto3" json:"base,omitempty"` // Path relative to the project root to the file to limit the diff to. // Optional. Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*DownloadDiffRequest) Descriptor
deprecated
func (*DownloadDiffRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadDiffRequest.ProtoReflect.Descriptor instead.
func (*DownloadDiffRequest) GetBase ¶
func (x *DownloadDiffRequest) GetBase() string
func (*DownloadDiffRequest) GetCommittish ¶
func (x *DownloadDiffRequest) GetCommittish() string
func (*DownloadDiffRequest) GetPath ¶
func (x *DownloadDiffRequest) GetPath() string
func (*DownloadDiffRequest) GetProject ¶
func (x *DownloadDiffRequest) GetProject() string
func (*DownloadDiffRequest) ProtoMessage ¶
func (*DownloadDiffRequest) ProtoMessage()
func (*DownloadDiffRequest) ProtoReflect ¶
func (x *DownloadDiffRequest) ProtoReflect() protoreflect.Message
func (*DownloadDiffRequest) Reset ¶
func (x *DownloadDiffRequest) Reset()
func (*DownloadDiffRequest) String ¶
func (x *DownloadDiffRequest) String() string
func (*DownloadDiffRequest) Validate ¶
func (r *DownloadDiffRequest) Validate() error
Validate returns an error if r is invalid.
type DownloadDiffResponse ¶
type DownloadDiffResponse struct { // Decoded contents of the diff. Contents string `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"` // contains filtered or unexported fields }
func (*DownloadDiffResponse) Descriptor
deprecated
func (*DownloadDiffResponse) Descriptor() ([]byte, []int)
Deprecated: Use DownloadDiffResponse.ProtoReflect.Descriptor instead.
func (*DownloadDiffResponse) GetContents ¶
func (x *DownloadDiffResponse) GetContents() string
func (*DownloadDiffResponse) ProtoMessage ¶
func (*DownloadDiffResponse) ProtoMessage()
func (*DownloadDiffResponse) ProtoReflect ¶
func (x *DownloadDiffResponse) ProtoReflect() protoreflect.Message
func (*DownloadDiffResponse) Reset ¶
func (x *DownloadDiffResponse) Reset()
func (*DownloadDiffResponse) String ¶
func (x *DownloadDiffResponse) String() string
type DownloadFileRequest ¶
type DownloadFileRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // The commit where to start the listing from. // The value can be: // - a git revision as 40-char string or its prefix so long as its unique in repo. // - a ref such as "refs/heads/branch" // - a ref defined as n-th parent of R in the form "R~n". // For example, "main~2" or "deadbeef~1". // // Required. Committish string `protobuf:"bytes,2,opt,name=committish,proto3" json:"committish,omitempty"` // Path relative to the project root to the file to download. Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // Format to download file in (default is TEXT). Format DownloadFileRequest_Format `protobuf:"varint,4,opt,name=format,proto3,enum=gitiles.DownloadFileRequest_Format" json:"format,omitempty"` // contains filtered or unexported fields }
func (*DownloadFileRequest) Descriptor
deprecated
func (*DownloadFileRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadFileRequest.ProtoReflect.Descriptor instead.
func (*DownloadFileRequest) GetCommittish ¶
func (x *DownloadFileRequest) GetCommittish() string
func (*DownloadFileRequest) GetFormat ¶
func (x *DownloadFileRequest) GetFormat() DownloadFileRequest_Format
func (*DownloadFileRequest) GetPath ¶
func (x *DownloadFileRequest) GetPath() string
func (*DownloadFileRequest) GetProject ¶
func (x *DownloadFileRequest) GetProject() string
func (*DownloadFileRequest) ProtoMessage ¶
func (*DownloadFileRequest) ProtoMessage()
func (*DownloadFileRequest) ProtoReflect ¶
func (x *DownloadFileRequest) ProtoReflect() protoreflect.Message
func (*DownloadFileRequest) Reset ¶
func (x *DownloadFileRequest) Reset()
func (*DownloadFileRequest) String ¶
func (x *DownloadFileRequest) String() string
func (*DownloadFileRequest) Validate ¶
func (r *DownloadFileRequest) Validate() error
Validate returns an error if r is invalid.
type DownloadFileRequest_Format ¶
type DownloadFileRequest_Format int32
const ( DownloadFileRequest_FORMAT_INVALID DownloadFileRequest_Format = 0 DownloadFileRequest_TEXT DownloadFileRequest_Format = 1 DownloadFileRequest_JSON DownloadFileRequest_Format = 2 )
func (DownloadFileRequest_Format) Descriptor ¶
func (DownloadFileRequest_Format) Descriptor() protoreflect.EnumDescriptor
func (DownloadFileRequest_Format) Enum ¶
func (x DownloadFileRequest_Format) Enum() *DownloadFileRequest_Format
func (DownloadFileRequest_Format) EnumDescriptor
deprecated
func (DownloadFileRequest_Format) EnumDescriptor() ([]byte, []int)
Deprecated: Use DownloadFileRequest_Format.Descriptor instead.
func (DownloadFileRequest_Format) Number ¶
func (x DownloadFileRequest_Format) Number() protoreflect.EnumNumber
func (DownloadFileRequest_Format) String ¶
func (x DownloadFileRequest_Format) String() string
func (DownloadFileRequest_Format) Type ¶
func (DownloadFileRequest_Format) Type() protoreflect.EnumType
type DownloadFileResponse ¶
type DownloadFileResponse struct { // Decoded contents of the downloaded file. // // The underlying server RPC streams back the contents. This API simplifies // the RPC to a non-streaming response. Contents string `protobuf:"bytes,1,opt,name=contents,proto3" json:"contents,omitempty"` // contains filtered or unexported fields }
func (*DownloadFileResponse) Descriptor
deprecated
func (*DownloadFileResponse) Descriptor() ([]byte, []int)
Deprecated: Use DownloadFileResponse.ProtoReflect.Descriptor instead.
func (*DownloadFileResponse) GetContents ¶
func (x *DownloadFileResponse) GetContents() string
func (*DownloadFileResponse) ProtoMessage ¶
func (*DownloadFileResponse) ProtoMessage()
func (*DownloadFileResponse) ProtoReflect ¶
func (x *DownloadFileResponse) ProtoReflect() protoreflect.Message
func (*DownloadFileResponse) Reset ¶
func (x *DownloadFileResponse) Reset()
func (*DownloadFileResponse) String ¶
func (x *DownloadFileResponse) String() string
type Fake ¶
type Fake struct {
// contains filtered or unexported fields
}
Fake allows testing of Gitiles API without using actual Gitiles server. User can set data using SetRepository method.
func (*Fake) Archive ¶
func (f *Fake) Archive(ctx context.Context, in *ArchiveRequest, opts ...grpc.CallOption) (*ArchiveResponse, error)
Archive retrieves archived contents of the project. This is not implemented.
An archive is a shallow bundle of the contents of a repository.
DEPRECATED: Use DownloadFile to obtain plain text files. TODO(pprabhu): Migrate known users to DownloadFile and delete this RPC.
func (*Fake) DownloadDiff ¶
func (f *Fake) DownloadDiff(ctx context.Context, in *DownloadDiffRequest, opts ...grpc.CallOption) (*DownloadDiffResponse, error)
DownloadDiff retrieves a diff of a revision from the project. This is not implemented.
func (*Fake) DownloadFile ¶
func (f *Fake) DownloadFile(ctx context.Context, in *DownloadFileRequest, opts ...grpc.CallOption) (*DownloadFileResponse, error)
DownloadFile retrieves a file from the project. This is not implemented.
func (*Fake) GetProject ¶
func (f *Fake) GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*Project, error)
GetProject retrieves a project.
func (*Fake) ListFiles ¶
func (f *Fake) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
ListFiles retrieves a list of files at the given revision. This is not implemented.
func (*Fake) Log ¶
func (f *Fake) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error)
Log retrieves commit log. Merge commits are supported, but it implements simple logic and likely won't return results in the same order as Gitiles.
func (*Fake) Projects ¶
func (f *Fake) Projects(ctx context.Context, in *ProjectsRequest, opts ...grpc.CallOption) (*ProjectsResponse, error)
Projects retrieves list of available Gitiles projects
func (*Fake) Refs ¶
func (f *Fake) Refs(ctx context.Context, in *RefsRequest, opts ...grpc.CallOption) (*RefsResponse, error)
Refs retrieves repo refs.
func (*Fake) SetRepository ¶
SetRepository stores provided references and commits to desired repository. If repository is previously set, it will override it.
refs keys are references, keys are revisions. Example: f.SetRepository(
"foo", []string{"refs/heads/master", "rev1"}, []*git.Commit{ {Id: "rev1", Parents: []string{"rev0"}}, {Id: "rev0"} }
) Represents following repository: name: foo references: * refs/heads/master points to rev1 commits: rev1 --> rev0 (root commit)
type GetProjectRequest ¶
type GetProjectRequest struct { // The name of the Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*GetProjectRequest) Descriptor
deprecated
func (*GetProjectRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetProjectRequest.ProtoReflect.Descriptor instead.
func (*GetProjectRequest) GetName ¶
func (x *GetProjectRequest) GetName() string
func (*GetProjectRequest) ProtoMessage ¶
func (*GetProjectRequest) ProtoMessage()
func (*GetProjectRequest) ProtoReflect ¶
func (x *GetProjectRequest) ProtoReflect() protoreflect.Message
func (*GetProjectRequest) Reset ¶
func (x *GetProjectRequest) Reset()
func (*GetProjectRequest) String ¶
func (x *GetProjectRequest) String() string
type GitilesClient ¶
type GitilesClient interface { // Log retrieves commit log. Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*LogResponse, error) // Refs retrieves repo refs. Refs(ctx context.Context, in *RefsRequest, opts ...grpc.CallOption) (*RefsResponse, error) // Archive retrieves archived content bundle under the provided path in a // repo or the entire repo if the path is not provided. // // Note: for a single file, use DownloadFile to obtain the plain text file. Archive(ctx context.Context, in *ArchiveRequest, opts ...grpc.CallOption) (*ArchiveResponse, error) // DownloadFile retrieves a file from the project. DownloadFile(ctx context.Context, in *DownloadFileRequest, opts ...grpc.CallOption) (*DownloadFileResponse, error) // DownloadDiff retrieves a diff of a revision from the project. DownloadDiff(ctx context.Context, in *DownloadDiffRequest, opts ...grpc.CallOption) (*DownloadDiffResponse, error) // GetProject retrieves a project. GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*Project, error) // Projects retrieves list of available Gitiles projects. Projects(ctx context.Context, in *ProjectsRequest, opts ...grpc.CallOption) (*ProjectsResponse, error) // ListFiles retrieves a list of files at the given revision. ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) }
GitilesClient is the client API for Gitiles service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGitilesClient ¶
func NewGitilesClient(cc grpc.ClientConnInterface) GitilesClient
func NewGitilesPRPCClient ¶
func NewGitilesPRPCClient(client *prpc.Client) GitilesClient
type GitilesServer ¶
type GitilesServer interface { // Log retrieves commit log. Log(context.Context, *LogRequest) (*LogResponse, error) // Refs retrieves repo refs. Refs(context.Context, *RefsRequest) (*RefsResponse, error) // Archive retrieves archived content bundle under the provided path in a // repo or the entire repo if the path is not provided. // // Note: for a single file, use DownloadFile to obtain the plain text file. Archive(context.Context, *ArchiveRequest) (*ArchiveResponse, error) // DownloadFile retrieves a file from the project. DownloadFile(context.Context, *DownloadFileRequest) (*DownloadFileResponse, error) // DownloadDiff retrieves a diff of a revision from the project. DownloadDiff(context.Context, *DownloadDiffRequest) (*DownloadDiffResponse, error) // GetProject retrieves a project. GetProject(context.Context, *GetProjectRequest) (*Project, error) // Projects retrieves list of available Gitiles projects. Projects(context.Context, *ProjectsRequest) (*ProjectsResponse, error) // ListFiles retrieves a list of files at the given revision. ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error) }
GitilesServer is the server API for Gitiles service.
type ListFilesRequest ¶
type ListFilesRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // The git revision to list files at. // The value can be: // - a git revision as 40-char string or its prefix so long as its unique in repo. // - a ref such as "refs/heads/branch" // - a ref defined as n-th parent of R in the form "R~n". // For example, "main~2" or "deadbeef~1". // // Required. Committish string `protobuf:"bytes,2,opt,name=committish,proto3" json:"committish,omitempty"` // Path relative to the project root to limit the list to. Only direct // children will be returned -- the request does not recursively process // child directories. // Optional. Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*ListFilesRequest) Descriptor
deprecated
func (*ListFilesRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListFilesRequest.ProtoReflect.Descriptor instead.
func (*ListFilesRequest) GetCommittish ¶
func (x *ListFilesRequest) GetCommittish() string
func (*ListFilesRequest) GetPath ¶
func (x *ListFilesRequest) GetPath() string
func (*ListFilesRequest) GetProject ¶
func (x *ListFilesRequest) GetProject() string
func (*ListFilesRequest) ProtoMessage ¶
func (*ListFilesRequest) ProtoMessage()
func (*ListFilesRequest) ProtoReflect ¶
func (x *ListFilesRequest) ProtoReflect() protoreflect.Message
func (*ListFilesRequest) Reset ¶
func (x *ListFilesRequest) Reset()
func (*ListFilesRequest) String ¶
func (x *ListFilesRequest) String() string
func (*ListFilesRequest) Validate ¶
func (r *ListFilesRequest) Validate() error
Validate returns an error if r is invalid.
type ListFilesResponse ¶
type ListFilesResponse struct { // List of files. Files []*git.File `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` // contains filtered or unexported fields }
func (*ListFilesResponse) Descriptor
deprecated
func (*ListFilesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListFilesResponse.ProtoReflect.Descriptor instead.
func (*ListFilesResponse) GetFiles ¶
func (x *ListFilesResponse) GetFiles() []*git.File
func (*ListFilesResponse) ProtoMessage ¶
func (*ListFilesResponse) ProtoMessage()
func (*ListFilesResponse) ProtoReflect ¶
func (x *ListFilesResponse) ProtoReflect() protoreflect.Message
func (*ListFilesResponse) Reset ¶
func (x *ListFilesResponse) Reset()
func (*ListFilesResponse) String ¶
func (x *ListFilesResponse) String() string
type LogRequest ¶
type LogRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // The commit where to start the listing from. // The value can be: // - a git revision as 40-char string or its prefix so long as its unique in repo. // - a ref such as "refs/heads/branch" // - a ref defined as n-th parent of R in the form "R~n". // For example, "main~2" or "deadbeef~1". // // Required. Committish string `protobuf:"bytes,3,opt,name=committish,proto3" json:"committish,omitempty"` // If specified, only commits not reachable from this commit (inclusive) // will be returned. // // In git's notation, this is // // $ git log ^exclude_ancestors_of committish // OR // $ git log exclude_ancestors_of..committish // // https://git-scm.com/docs/gitrevisions#gitrevisions-Theememtwo-dotRangeNotation // // For example, given this repo // // base -> A -> B -> C == refs/heads/main // \ // X -> Y -> Z == refs/heads/release // // calling Log(committish='refs/heads/release', // // exclude_ancestors_of='refs/heads/main') // // will return ['Z', Y', 'X']. ExcludeAncestorsOf string `protobuf:"bytes,2,opt,name=exclude_ancestors_of,json=excludeAncestorsOf,proto3" json:"exclude_ancestors_of,omitempty"` // If true, include tree diff in commits. TreeDiff bool `protobuf:"varint,4,opt,name=tree_diff,json=treeDiff,proto3" json:"tree_diff,omitempty"` // If set to a non-empty value, the log will be for the given path Path string `protobuf:"bytes,12,opt,name=path,proto3" json:"path,omitempty"` // Value of next_page_token in LogResponse to continue. PageToken string `protobuf:"bytes,10,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // If > 0, number of commits to retrieve. PageSize int32 `protobuf:"varint,11,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
LogRequest is request message for Gitiles.Log rpc.
func (*LogRequest) Descriptor
deprecated
func (*LogRequest) Descriptor() ([]byte, []int)
Deprecated: Use LogRequest.ProtoReflect.Descriptor instead.
func (*LogRequest) GetCommittish ¶
func (x *LogRequest) GetCommittish() string
func (*LogRequest) GetExcludeAncestorsOf ¶
func (x *LogRequest) GetExcludeAncestorsOf() string
func (*LogRequest) GetPageSize ¶
func (x *LogRequest) GetPageSize() int32
func (*LogRequest) GetPageToken ¶
func (x *LogRequest) GetPageToken() string
func (*LogRequest) GetPath ¶
func (x *LogRequest) GetPath() string
func (*LogRequest) GetProject ¶
func (x *LogRequest) GetProject() string
func (*LogRequest) GetTreeDiff ¶
func (x *LogRequest) GetTreeDiff() bool
func (*LogRequest) ProtoMessage ¶
func (*LogRequest) ProtoMessage()
func (*LogRequest) ProtoReflect ¶
func (x *LogRequest) ProtoReflect() protoreflect.Message
func (*LogRequest) Reset ¶
func (x *LogRequest) Reset()
func (*LogRequest) String ¶
func (x *LogRequest) String() string
func (*LogRequest) Validate ¶
func (r *LogRequest) Validate() error
Validate returns an error if r is invalid.
type LogResponse ¶
type LogResponse struct { // Retrieved commits. Log []*git.Commit `protobuf:"bytes,1,rep,name=log,proto3" json:"log,omitempty"` // A page token for next LogRequest to fetch next page of commits. NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
LogRequest is response message for Gitiles.Log rpc.
func (*LogResponse) Descriptor
deprecated
func (*LogResponse) Descriptor() ([]byte, []int)
Deprecated: Use LogResponse.ProtoReflect.Descriptor instead.
func (*LogResponse) GetLog ¶
func (x *LogResponse) GetLog() []*git.Commit
func (*LogResponse) GetNextPageToken ¶
func (x *LogResponse) GetNextPageToken() string
func (*LogResponse) ProtoMessage ¶
func (*LogResponse) ProtoMessage()
func (*LogResponse) ProtoReflect ¶
func (x *LogResponse) ProtoReflect() protoreflect.Message
func (*LogResponse) Reset ¶
func (x *LogResponse) Reset()
func (*LogResponse) String ¶
func (x *LogResponse) String() string
type Project ¶
type Project struct { // The name of the Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The URL to clone the project. CloneUrl string `protobuf:"bytes,2,opt,name=clone_url,json=cloneUrl,proto3" json:"clone_url,omitempty"` // contains filtered or unexported fields }
func (*Project) Descriptor
deprecated
func (*Project) GetCloneUrl ¶
func (*Project) ProtoMessage ¶
func (*Project) ProtoMessage()
func (*Project) ProtoReflect ¶
func (x *Project) ProtoReflect() protoreflect.Message
type ProjectsRequest ¶
type ProjectsRequest struct {
// contains filtered or unexported fields
}
func (*ProjectsRequest) Descriptor
deprecated
func (*ProjectsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ProjectsRequest.ProtoReflect.Descriptor instead.
func (*ProjectsRequest) ProtoMessage ¶
func (*ProjectsRequest) ProtoMessage()
func (*ProjectsRequest) ProtoReflect ¶
func (x *ProjectsRequest) ProtoReflect() protoreflect.Message
func (*ProjectsRequest) Reset ¶
func (x *ProjectsRequest) Reset()
func (*ProjectsRequest) String ¶
func (x *ProjectsRequest) String() string
type ProjectsResponse ¶
type ProjectsResponse struct { // List of available Gitiles projects Projects []string `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"` // contains filtered or unexported fields }
func (*ProjectsResponse) Descriptor
deprecated
func (*ProjectsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProjectsResponse.ProtoReflect.Descriptor instead.
func (*ProjectsResponse) GetProjects ¶
func (x *ProjectsResponse) GetProjects() []string
func (*ProjectsResponse) ProtoMessage ¶
func (*ProjectsResponse) ProtoMessage()
func (*ProjectsResponse) ProtoReflect ¶
func (x *ProjectsResponse) ProtoReflect() protoreflect.Message
func (*ProjectsResponse) Reset ¶
func (x *ProjectsResponse) Reset()
func (*ProjectsResponse) String ¶
func (x *ProjectsResponse) String() string
type RefsRequest ¶
type RefsRequest struct { // Gitiles project, e.g. "chromium/src" part in // https://chromium.googlesource.com/chromium/src/+/main // Required. Project string `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` // Limits which refs to resolve to only those matching {refsPath}/*. // // Must be "refs" or start with "refs/". // Must not include glob '*'. // Use "refs/heads" to retrieve all branches. // // To fetch **all** refs in a repo, specify just "refs" but beware of two // caveats: // - refs returned include a ref for each patchset for each Gerrit change // associated with the repo. // - returned map will contain special "HEAD" ref whose value in resulting map // will be name of the actual ref to which "HEAD" points, which is typically // "refs/heads/main". // // Thus, if you are looking for all tags and all branches of repo, it's // recommended to issue two Refs calls limited to "refs/tags" and "refs/heads" // instead of one call for "refs". // // Since Gerrit allows per-ref ACLs, it is possible that some refs matching // refPrefix would not be present in results because current user isn't granted // read permission on them. RefsPath string `protobuf:"bytes,2,opt,name=refs_path,json=refsPath,proto3" json:"refs_path,omitempty"` // contains filtered or unexported fields }
RefsRequest is a request message of Gitiles.Refs RPC.
func (*RefsRequest) Descriptor
deprecated
func (*RefsRequest) Descriptor() ([]byte, []int)
Deprecated: Use RefsRequest.ProtoReflect.Descriptor instead.
func (*RefsRequest) GetProject ¶
func (x *RefsRequest) GetProject() string
func (*RefsRequest) GetRefsPath ¶
func (x *RefsRequest) GetRefsPath() string
func (*RefsRequest) ProtoMessage ¶
func (*RefsRequest) ProtoMessage()
func (*RefsRequest) ProtoReflect ¶
func (x *RefsRequest) ProtoReflect() protoreflect.Message
func (*RefsRequest) Reset ¶
func (x *RefsRequest) Reset()
func (*RefsRequest) String ¶
func (x *RefsRequest) String() string
func (*RefsRequest) Validate ¶
func (r *RefsRequest) Validate() error
Validate returns an error if r is invalid.
type RefsResponse ¶
type RefsResponse struct { // revisions maps a ref to a revision. // Git branches have keys start with "refs/heads/". Revisions map[string]string `` /* 159-byte string literal not displayed */ // contains filtered or unexported fields }
RefsResponse is a response message of Gitiles.Refs RPC.
func (*RefsResponse) Descriptor
deprecated
func (*RefsResponse) Descriptor() ([]byte, []int)
Deprecated: Use RefsResponse.ProtoReflect.Descriptor instead.
func (*RefsResponse) GetRevisions ¶
func (x *RefsResponse) GetRevisions() map[string]string
func (*RefsResponse) ProtoMessage ¶
func (*RefsResponse) ProtoMessage()
func (*RefsResponse) ProtoReflect ¶
func (x *RefsResponse) ProtoReflect() protoreflect.Message
func (*RefsResponse) Reset ¶
func (x *RefsResponse) Reset()
func (*RefsResponse) String ¶
func (x *RefsResponse) String() string
type UnimplementedGitilesServer ¶
type UnimplementedGitilesServer struct { }
UnimplementedGitilesServer can be embedded to have forward compatible implementations.
func (*UnimplementedGitilesServer) Archive ¶
func (*UnimplementedGitilesServer) Archive(context.Context, *ArchiveRequest) (*ArchiveResponse, error)
func (*UnimplementedGitilesServer) DownloadDiff ¶
func (*UnimplementedGitilesServer) DownloadDiff(context.Context, *DownloadDiffRequest) (*DownloadDiffResponse, error)
func (*UnimplementedGitilesServer) DownloadFile ¶
func (*UnimplementedGitilesServer) DownloadFile(context.Context, *DownloadFileRequest) (*DownloadFileResponse, error)
func (*UnimplementedGitilesServer) GetProject ¶
func (*UnimplementedGitilesServer) GetProject(context.Context, *GetProjectRequest) (*Project, error)
func (*UnimplementedGitilesServer) ListFiles ¶
func (*UnimplementedGitilesServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
func (*UnimplementedGitilesServer) Log ¶
func (*UnimplementedGitilesServer) Log(context.Context, *LogRequest) (*LogResponse, error)
func (*UnimplementedGitilesServer) Projects ¶
func (*UnimplementedGitilesServer) Projects(context.Context, *ProjectsRequest) (*ProjectsResponse, error)
func (*UnimplementedGitilesServer) Refs ¶
func (*UnimplementedGitilesServer) Refs(context.Context, *RefsRequest) (*RefsResponse, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_gitiles is a generated GoMock package.
|
Package mock_gitiles is a generated GoMock package. |