blob

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: storage.go

Generated by this command:

mockgen -source=storage.go -destination=mock.go -package=blob -typed

Package blob is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64ToUrl

func Base64ToUrl(s string) (string, error)

Types

type Blob

type Blob struct {
	*blobTypes.Blob
	Commitment []byte
	Height     uint64
}

func (Blob) ContentType

func (blob Blob) ContentType() string

func (Blob) String

func (blob Blob) String() string

type MockStorage

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

MockStorage is a mock of Storage interface.

func NewMockStorage

func NewMockStorage(ctrl *gomock.Controller) *MockStorage

NewMockStorage creates a new mock instance.

func (*MockStorage) EXPECT

func (m *MockStorage) EXPECT() *MockStorageMockRecorder

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

func (*MockStorage) Head

func (m *MockStorage) Head(ctx context.Context) (uint64, error)

Head mocks base method.

func (*MockStorage) Save

func (m *MockStorage) Save(ctx context.Context, blob Blob) error

Save mocks base method.

func (*MockStorage) SaveBulk

func (m *MockStorage) SaveBulk(ctx context.Context, blobs []Blob) error

SaveBulk mocks base method.

func (*MockStorage) UpdateHead

func (m *MockStorage) UpdateHead(ctx context.Context, head uint64) error

UpdateHead mocks base method.

type MockStorageMockRecorder

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

MockStorageMockRecorder is the mock recorder for MockStorage.

func (*MockStorageMockRecorder) Head

Head indicates an expected call of Head.

func (*MockStorageMockRecorder) Save

func (mr *MockStorageMockRecorder) Save(ctx, blob any) *StorageSaveCall

Save indicates an expected call of Save.

func (*MockStorageMockRecorder) SaveBulk

func (mr *MockStorageMockRecorder) SaveBulk(ctx, blobs any) *StorageSaveBulkCall

SaveBulk indicates an expected call of SaveBulk.

func (*MockStorageMockRecorder) UpdateHead

func (mr *MockStorageMockRecorder) UpdateHead(ctx, head any) *StorageUpdateHeadCall

UpdateHead indicates an expected call of UpdateHead.

type R2

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

func NewR2

func NewR2(cfg R2Config) R2

func (R2) Blob

func (r2 R2) Blob(ctx context.Context, height pkgTypes.Level, namespace, commitment string) (blob nodeTypes.Blob, err error)

func (R2) Blobs

func (r2 R2) Blobs(ctx context.Context, height pkgTypes.Level, hash ...string) ([]nodeTypes.Blob, error)

func (R2) Head

func (r2 R2) Head(ctx context.Context) (uint64, error)

func (*R2) Init

func (r2 *R2) Init(ctx context.Context) error

func (R2) Save

func (r2 R2) Save(ctx context.Context, blob Blob) error

func (R2) SaveBulk

func (r2 R2) SaveBulk(ctx context.Context, blobs []Blob) error

func (R2) UpdateHead

func (r2 R2) UpdateHead(ctx context.Context, head uint64) error

type R2Config

type R2Config struct {
	BucketName      string
	AccountId       string
	AccessKeyId     string
	AccessKeySecret string
}

func (R2Config) R2Url

func (cfg R2Config) R2Url() string

type Storage

type Storage interface {
	Save(ctx context.Context, blob Blob) error
	SaveBulk(ctx context.Context, blobs []Blob) error
	Head(ctx context.Context) (uint64, error)
	UpdateHead(ctx context.Context, head uint64) error
}

type StorageHeadCall

type StorageHeadCall struct {
	*gomock.Call
}

StorageHeadCall wrap *gomock.Call

func (*StorageHeadCall) Do

Do rewrite *gomock.Call.Do

func (*StorageHeadCall) DoAndReturn

func (c *StorageHeadCall) DoAndReturn(f func(context.Context) (uint64, error)) *StorageHeadCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*StorageHeadCall) Return

func (c *StorageHeadCall) Return(arg0 uint64, arg1 error) *StorageHeadCall

Return rewrite *gomock.Call.Return

type StorageSaveBulkCall

type StorageSaveBulkCall struct {
	*gomock.Call
}

StorageSaveBulkCall wrap *gomock.Call

func (*StorageSaveBulkCall) Do

Do rewrite *gomock.Call.Do

func (*StorageSaveBulkCall) DoAndReturn

func (c *StorageSaveBulkCall) DoAndReturn(f func(context.Context, []Blob) error) *StorageSaveBulkCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*StorageSaveBulkCall) Return

Return rewrite *gomock.Call.Return

type StorageSaveCall

type StorageSaveCall struct {
	*gomock.Call
}

StorageSaveCall wrap *gomock.Call

func (*StorageSaveCall) Do

Do rewrite *gomock.Call.Do

func (*StorageSaveCall) DoAndReturn

func (c *StorageSaveCall) DoAndReturn(f func(context.Context, Blob) error) *StorageSaveCall

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*StorageSaveCall) Return

func (c *StorageSaveCall) Return(arg0 error) *StorageSaveCall

Return rewrite *gomock.Call.Return

type StorageUpdateHeadCall

type StorageUpdateHeadCall struct {
	*gomock.Call
}

StorageUpdateHeadCall wrap *gomock.Call

func (*StorageUpdateHeadCall) Do

Do rewrite *gomock.Call.Do

func (*StorageUpdateHeadCall) DoAndReturn

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*StorageUpdateHeadCall) Return

Return rewrite *gomock.Call.Return

Jump to

Keyboard shortcuts

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