Documentation ¶
Overview ¶
Package gs is a generated GoMock package.
Package gs contains functionality related to Google Cloud Storage of the AuthDB.
Index ¶
- func GetPath(ctx context.Context) (string, error)
- func IsValidPath(path string) bool
- func NewGSClient(ctx context.Context) (*gsClient, error)
- func UpdateReaders(ctx context.Context, readers stringset.Set) (retErr error)
- func UploadAuthDB(ctx context.Context, signedAuthDB *protocol.SignedAuthDB, ...) (retErr error)
- type Client
- type MockClient
- func (m *MockClient) Close() error
- func (m *MockClient) EXPECT() *MockClientMockRecorder
- func (m *MockClient) UpdateReadACL(ctx context.Context, objectPath string, readers stringset.Set) error
- func (m *MockClient) WriteFile(ctx context.Context, objectPath, contentType string, data []byte, ...) error
- type MockClientMockRecorder
- type MockedClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidPath ¶
IsValidPath returns whether the given path is considered a valid Google Storage path, where:
- the path is not empty; and
- the path has no trailing "/", as object paths are constructed assuming this.
func NewGSClient ¶
NewGSClient creates a new production Google Storage client; i.e. this client is actually Google Storage, not a mock.
func UpdateReaders ¶
UpdateReaders updates which users have read access to the latest signed AuthDB and AuthDBRevision in Google Storage.
func UploadAuthDB ¶
func UploadAuthDB(ctx context.Context, signedAuthDB *protocol.SignedAuthDB, revision *protocol.AuthDBRevision, readers stringset.Set, dryRun bool) (retErr error)
UploadAuthDB uploads the signed AuthDB and AuthDBRevision to Google Storage.
Types ¶
type Client ¶
type Client interface { // Close closes the connection to Google Storage. Close() error // UpdateReadACL updates the object ACLs to grant read access to the // given readers; readers must be user emails. UpdateReadACL(ctx context.Context, objectPath string, readers stringset.Set) error // WriteFile writes the given data to the GS path with the object ACLs // provided. WriteFile(ctx context.Context, objectPath, contentType string, data []byte, acls []storage.ACLRule) error }
Client abstracts functionality to connect with and use Google Storage.
Non-production implementations are used primarily for testing.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) UpdateReadACL ¶
func (m *MockClient) UpdateReadACL(ctx context.Context, objectPath string, readers stringset.Set) error
UpdateReadACL mocks base method.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) Close ¶
func (mr *MockClientMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockClientMockRecorder) UpdateReadACL ¶
func (mr *MockClientMockRecorder) UpdateReadACL(ctx, objectPath, readers interface{}) *gomock.Call
UpdateReadACL indicates an expected call of UpdateReadACL.
func (*MockClientMockRecorder) WriteFile ¶
func (mr *MockClientMockRecorder) WriteFile(ctx, objectPath, contentType, data, acls interface{}) *gomock.Call
WriteFile indicates an expected call of WriteFile.
type MockedClient ¶
type MockedClient struct { Client *MockClient Ctx context.Context }
MockedClient is a mocked Google Storage client for testing. It wraps a MockClient and a context with the mocked client
func NewMockedClient ¶
func NewMockedClient(ctx context.Context, ctl *gomock.Controller) *MockedClient
NewMockedClient returns a new MockedClient for testing.