Documentation
¶
Overview ¶
Package ipfs is a generated GoMock package.
Index ¶
- Constants
- Variables
- func FindAllLinks(data []byte) []string
- func Hash(link string) (string, error)
- func Is(link string) bool
- func Link(gateway, hash string) string
- func Path(link string) string
- func ShuffleGateways(gateways []string) []string
- type Data
- type IPool
- type MockIPool
- type MockIPoolGetCall
- type MockIPoolGetFromNodeCall
- func (c *MockIPoolGetFromNodeCall) Do(f func(context.Context, string, string) (Data, error)) *MockIPoolGetFromNodeCall
- func (c *MockIPoolGetFromNodeCall) DoAndReturn(f func(context.Context, string, string) (Data, error)) *MockIPoolGetFromNodeCall
- func (c *MockIPoolGetFromNodeCall) Return(arg0 Data, arg1 error) *MockIPoolGetFromNodeCall
- type MockIPoolGetFromRandomGatewayCall
- func (c *MockIPoolGetFromRandomGatewayCall) Do(f func(context.Context, string) (Data, error)) *MockIPoolGetFromRandomGatewayCall
- func (c *MockIPoolGetFromRandomGatewayCall) DoAndReturn(f func(context.Context, string) (Data, error)) *MockIPoolGetFromRandomGatewayCall
- func (c *MockIPoolGetFromRandomGatewayCall) Return(arg0 Data, arg1 error) *MockIPoolGetFromRandomGatewayCall
- type MockIPoolMockRecorder
- type Node
- type Pool
- type Provider
Constants ¶
const (
IpfsLinkPrefix = "ipfs://"
)
prefix
Variables ¶
var ( ErrInvalidURI = errors.New("invalid URI") ErrEmptyIPFSGatewayList = errors.New("empty IPFS gateway list") ErrHTTPRequest = errors.New("HTTP request error") ErrJSONDecoding = errors.New("JSON decoding error") ErrNoIPFSResponse = errors.New("can't load document from IPFS") ErrInvalidCID = errors.New("invalid CID") )
Errors
Functions ¶
func ShuffleGateways ¶
ShuffleGateways - shuffle gateways for different request order for different files
Types ¶
type MockIPool ¶ added in v0.0.5
type MockIPool struct {
// contains filtered or unexported fields
}
MockIPool is a mock of IPool interface.
func NewMockIPool ¶ added in v0.0.5
func NewMockIPool(ctrl *gomock.Controller) *MockIPool
NewMockIPool creates a new mock instance.
func (*MockIPool) EXPECT ¶ added in v0.0.5
func (m *MockIPool) EXPECT() *MockIPoolMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIPool) GetFromNode ¶ added in v0.0.5
GetFromNode mocks base method.
type MockIPoolGetCall ¶ added in v0.0.5
MockIPoolGetCall wrap *gomock.Call
func (*MockIPoolGetCall) Do ¶ added in v0.0.5
func (c *MockIPoolGetCall) Do(f func(context.Context, string) (Data, error)) *MockIPoolGetCall
Do rewrite *gomock.Call.Do
func (*MockIPoolGetCall) DoAndReturn ¶ added in v0.0.5
func (c *MockIPoolGetCall) DoAndReturn(f func(context.Context, string) (Data, error)) *MockIPoolGetCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockIPoolGetCall) Return ¶ added in v0.0.5
func (c *MockIPoolGetCall) Return(arg0 Data, arg1 error) *MockIPoolGetCall
Return rewrite *gomock.Call.Return
type MockIPoolGetFromNodeCall ¶ added in v0.0.5
MockIPoolGetFromNodeCall wrap *gomock.Call
func (*MockIPoolGetFromNodeCall) Do ¶ added in v0.0.5
func (c *MockIPoolGetFromNodeCall) Do(f func(context.Context, string, string) (Data, error)) *MockIPoolGetFromNodeCall
Do rewrite *gomock.Call.Do
func (*MockIPoolGetFromNodeCall) DoAndReturn ¶ added in v0.0.5
func (c *MockIPoolGetFromNodeCall) DoAndReturn(f func(context.Context, string, string) (Data, error)) *MockIPoolGetFromNodeCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockIPoolGetFromNodeCall) Return ¶ added in v0.0.5
func (c *MockIPoolGetFromNodeCall) Return(arg0 Data, arg1 error) *MockIPoolGetFromNodeCall
Return rewrite *gomock.Call.Return
type MockIPoolGetFromRandomGatewayCall ¶ added in v0.0.5
MockIPoolGetFromRandomGatewayCall wrap *gomock.Call
func (*MockIPoolGetFromRandomGatewayCall) Do ¶ added in v0.0.5
func (c *MockIPoolGetFromRandomGatewayCall) Do(f func(context.Context, string) (Data, error)) *MockIPoolGetFromRandomGatewayCall
Do rewrite *gomock.Call.Do
func (*MockIPoolGetFromRandomGatewayCall) DoAndReturn ¶ added in v0.0.5
func (c *MockIPoolGetFromRandomGatewayCall) DoAndReturn(f func(context.Context, string) (Data, error)) *MockIPoolGetFromRandomGatewayCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockIPoolGetFromRandomGatewayCall) Return ¶ added in v0.0.5
func (c *MockIPoolGetFromRandomGatewayCall) Return(arg0 Data, arg1 error) *MockIPoolGetFromRandomGatewayCall
Return rewrite *gomock.Call.Return
type MockIPoolMockRecorder ¶ added in v0.0.5
type MockIPoolMockRecorder struct {
// contains filtered or unexported fields
}
MockIPoolMockRecorder is the mock recorder for MockIPool.
func (*MockIPoolMockRecorder) Get ¶ added in v0.0.5
func (mr *MockIPoolMockRecorder) Get(ctx, link any) *MockIPoolGetCall
Get indicates an expected call of Get.
func (*MockIPoolMockRecorder) GetFromNode ¶ added in v0.0.5
func (mr *MockIPoolMockRecorder) GetFromNode(ctx, link, node any) *MockIPoolGetFromNodeCall
GetFromNode indicates an expected call of GetFromNode.
func (*MockIPoolMockRecorder) GetFromRandomGateway ¶ added in v0.0.5
func (mr *MockIPoolMockRecorder) GetFromRandomGateway(ctx, link any) *MockIPoolGetFromRandomGatewayCall
GetFromRandomGateway indicates an expected call of GetFromRandomGateway.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node -