Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Factory ¶
func Factory(fakes map[string]*Host) gitiles.GitilesClientFactory
Factory creates a factory that returns RPC clients that use fake data to respond to requests.
The fake data is taken from the fakes argument, which is a map from host names to the Host instances containing the fake data for the host. Missing keys will have a default Host. A nil value indicates that the given host is not a gitiles instance.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client that will serve fake data for a given host.
func (*Client) DownloadFile ¶
func (c *Client) DownloadFile(ctx context.Context, request *gitilespb.DownloadFileRequest, options ...grpc.CallOption) (*gitilespb.DownloadFileResponse, error)
func (*Client) Log ¶
func (c *Client) Log(ctx context.Context, request *gitilespb.LogRequest, options ...grpc.CallOption) (*gitilespb.LogResponse, error)
type FileRevId ¶
type FileRevId struct { // Revision is the git revision. Revision string // Path is the path to the file. Path string }
FileRevId is an identifier for a file at a given git revision.
type Host ¶
type Host struct { // Projects maps project names to their details. // // Missing keys will have a default fake project. A nil value indicates the // the project does not exist. Projects map[string]*Project }
Host is the fake data for a gitiles host.
type Project ¶
type Project struct { // Refs maps refs to their revision. // // Missing keys will have a default revision computed. An empty string value // indicates that the ref does not exist. Refs map[string]string // Files maps file revision IDs to the contents. // // Missing keys indicate the file does not exist at the revision. Files map[FileRevId]*string }
Project is the fake data for a gitiles project.
Click to show internal directories.
Click to hide internal directories.