gitiles

package
v0.0.0-...-1643519 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 5

Documentation

Overview

Package gitiles contains Gitiles service definition.

Package gitiles is a generated GoMock package.

Index

Constants

View Source
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

This section is empty.

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptor.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 RegisterGitilesServer

func RegisterGitilesServer(s prpc.Registrar, srv GitilesServer)

Types

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)
}

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.ClientConn) 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)
}

GitilesServer is the server API for Gitiles service.

type LogRequest

type LogRequest struct {
	// Gitiles project, e.g. "chromium/src" part in
	// https://chromium.googlesource.com/chromium/src/+/master
	// 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" or just "branch"
	//   - a ref defined as n-th parent of R in the form "R~n".
	//     For example, "master~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/master
	//        \
	//         X -> Y -> Z  == refs/heads/release
	//
	// calling Log(committish='refs/heads/release',
	//             exclude_ancestors_of='refs/heads/master')
	// 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"`
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

LogRequest is request message for Gitiles.Log rpc.

func (*LogRequest) Descriptor

func (*LogRequest) Descriptor() ([]byte, []int)

func (*LogRequest) GetCommittish

func (m *LogRequest) GetCommittish() string

func (*LogRequest) GetExcludeAncestorsOf

func (m *LogRequest) GetExcludeAncestorsOf() string

func (*LogRequest) GetPageSize

func (m *LogRequest) GetPageSize() int32

func (*LogRequest) GetPageToken

func (m *LogRequest) GetPageToken() string

func (*LogRequest) GetProject

func (m *LogRequest) GetProject() string

func (*LogRequest) GetTreeDiff

func (m *LogRequest) GetTreeDiff() bool

func (*LogRequest) ProtoMessage

func (*LogRequest) ProtoMessage()

func (*LogRequest) Reset

func (m *LogRequest) Reset()

func (*LogRequest) String

func (m *LogRequest) String() string

func (*LogRequest) Validate

func (r *LogRequest) Validate() error

Validate returns an error if r is invalid.

func (*LogRequest) XXX_DiscardUnknown

func (m *LogRequest) XXX_DiscardUnknown()

func (*LogRequest) XXX_Marshal

func (m *LogRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogRequest) XXX_Merge

func (m *LogRequest) XXX_Merge(src proto.Message)

func (*LogRequest) XXX_Size

func (m *LogRequest) XXX_Size() int

func (*LogRequest) XXX_Unmarshal

func (m *LogRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

LogRequest is response message for Gitiles.Log rpc.

func (*LogResponse) Descriptor

func (*LogResponse) Descriptor() ([]byte, []int)

func (*LogResponse) GetLog

func (m *LogResponse) GetLog() []*git.Commit

func (*LogResponse) GetNextPageToken

func (m *LogResponse) GetNextPageToken() string

func (*LogResponse) ProtoMessage

func (*LogResponse) ProtoMessage()

func (*LogResponse) Reset

func (m *LogResponse) Reset()

func (*LogResponse) String

func (m *LogResponse) String() string

func (*LogResponse) XXX_DiscardUnknown

func (m *LogResponse) XXX_DiscardUnknown()

func (*LogResponse) XXX_Marshal

func (m *LogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogResponse) XXX_Merge

func (m *LogResponse) XXX_Merge(src proto.Message)

func (*LogResponse) XXX_Size

func (m *LogResponse) XXX_Size() int

func (*LogResponse) XXX_Unmarshal

func (m *LogResponse) XXX_Unmarshal(b []byte) error

type MockGitilesClient

type MockGitilesClient struct {
	// contains filtered or unexported fields
}

MockGitilesClient is a mock of GitilesClient interface

func NewMockGitilesClient

func NewMockGitilesClient(ctrl *gomock.Controller) *MockGitilesClient

NewMockGitilesClient creates a new mock instance

func (*MockGitilesClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockGitilesClient) Log

Log mocks base method

func (*MockGitilesClient) Refs

Refs mocks base method

type MockGitilesClientMockRecorder

type MockGitilesClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockGitilesClientMockRecorder is the mock recorder for MockGitilesClient

func (*MockGitilesClientMockRecorder) Log

func (mr *MockGitilesClientMockRecorder) Log(ctx, in interface{}, opts ...interface{}) *gomock.Call

Log indicates an expected call of Log

func (*MockGitilesClientMockRecorder) Refs

func (mr *MockGitilesClientMockRecorder) Refs(ctx, in interface{}, opts ...interface{}) *gomock.Call

Refs indicates an expected call of Refs

type MockGitilesServer

type MockGitilesServer struct {
	// contains filtered or unexported fields
}

MockGitilesServer is a mock of GitilesServer interface

func NewMockGitilesServer

func NewMockGitilesServer(ctrl *gomock.Controller) *MockGitilesServer

NewMockGitilesServer creates a new mock instance

func (*MockGitilesServer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockGitilesServer) Log

func (m *MockGitilesServer) Log(arg0 context.Context, arg1 *LogRequest) (*LogResponse, error)

Log mocks base method

func (*MockGitilesServer) Refs

Refs mocks base method

type MockGitilesServerMockRecorder

type MockGitilesServerMockRecorder struct {
	// contains filtered or unexported fields
}

MockGitilesServerMockRecorder is the mock recorder for MockGitilesServer

func (*MockGitilesServerMockRecorder) Log

func (mr *MockGitilesServerMockRecorder) Log(arg0, arg1 interface{}) *gomock.Call

Log indicates an expected call of Log

func (*MockGitilesServerMockRecorder) Refs

func (mr *MockGitilesServerMockRecorder) Refs(arg0, arg1 interface{}) *gomock.Call

Refs indicates an expected call of Refs

type RefsRequest

type RefsRequest struct {
	// Gitiles project, e.g. "chromium/src" part in
	// https://chromium.googlesource.com/chromium/src/+/master
	// 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/master".
	//
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

RefsRequest is a request message of Gitiles.Refs RPC.

func (*RefsRequest) Descriptor

func (*RefsRequest) Descriptor() ([]byte, []int)

func (*RefsRequest) GetProject

func (m *RefsRequest) GetProject() string

func (*RefsRequest) GetRefsPath

func (m *RefsRequest) GetRefsPath() string

func (*RefsRequest) ProtoMessage

func (*RefsRequest) ProtoMessage()

func (*RefsRequest) Reset

func (m *RefsRequest) Reset()

func (*RefsRequest) String

func (m *RefsRequest) String() string

func (*RefsRequest) Validate

func (r *RefsRequest) Validate() error

Validate returns an error if r is invalid.

func (*RefsRequest) XXX_DiscardUnknown

func (m *RefsRequest) XXX_DiscardUnknown()

func (*RefsRequest) XXX_Marshal

func (m *RefsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RefsRequest) XXX_Merge

func (m *RefsRequest) XXX_Merge(src proto.Message)

func (*RefsRequest) XXX_Size

func (m *RefsRequest) XXX_Size() int

func (*RefsRequest) XXX_Unmarshal

func (m *RefsRequest) XXX_Unmarshal(b []byte) error

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 */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

RefsResponse is a response message of Gitiles.Refs RPC.

func (*RefsResponse) Descriptor

func (*RefsResponse) Descriptor() ([]byte, []int)

func (*RefsResponse) GetRevisions

func (m *RefsResponse) GetRevisions() map[string]string

func (*RefsResponse) ProtoMessage

func (*RefsResponse) ProtoMessage()

func (*RefsResponse) Reset

func (m *RefsResponse) Reset()

func (*RefsResponse) String

func (m *RefsResponse) String() string

func (*RefsResponse) XXX_DiscardUnknown

func (m *RefsResponse) XXX_DiscardUnknown()

func (*RefsResponse) XXX_Marshal

func (m *RefsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RefsResponse) XXX_Merge

func (m *RefsResponse) XXX_Merge(src proto.Message)

func (*RefsResponse) XXX_Size

func (m *RefsResponse) XXX_Size() int

func (*RefsResponse) XXX_Unmarshal

func (m *RefsResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL