Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateConnectionStr(v *viper.Viper, vs vault.Secrets) string
- type MockStorage
- func (_m *MockStorage) DeleteFile(ctx context.Context, filePath string) error
- func (_m *MockStorage) DownloadFile(ctx context.Context, filePath string) ([]byte, error)
- func (_m *MockStorage) Purge(ctx context.Context, from time.Time) (int, error)
- func (_m *MockStorage) SaveFile(ctx context.Context, filePath string, file []byte) error
- type Storage
Constants ¶
View Source
const (
EnvGCSCredentials = "GCS_CREDENTIALS"
)
Variables ¶
View Source
var StorageLatency = promauto.NewHistogramVec( prometheus.HistogramOpts{ Name: "storage_latency", Help: "Duration of storage queries", }, []string{"query"}, )
StorageLatency is the duration of GCS queries.
Functions ¶
Types ¶
type MockStorage ¶
MockStorage is an autogenerated mock type for the Storage type
func NewMockStorage ¶
func NewMockStorage(t interface { mock.TestingT Cleanup(func()) }) *MockStorage
NewMockStorage creates a new instance of MockStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockStorage) DeleteFile ¶
func (_m *MockStorage) DeleteFile(ctx context.Context, filePath string) error
DeleteFile provides a mock function with given fields: ctx, filePath
func (*MockStorage) DownloadFile ¶
DownloadFile provides a mock function with given fields: ctx, filePath
type Storage ¶
type Storage interface { // SaveFile uploads a file to the storage bucket. This will replace any existing file with the same name. SaveFile(ctx context.Context, filePath string, file []byte) error // DownloadFile downloads a file from the storage bucket. DownloadFile(ctx context.Context, filePath string) ([]byte, error) // DeleteFile deletes a file from the storage bucket. DeleteFile(ctx context.Context, filePath string) error // Purge purges the data from the storage bucket out of the given range. Purge(ctx context.Context, from time.Time) (int, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.