Documentation ¶
Index ¶
- func NewIPFSRepo(cfg IPFSRepoConfigurationProvider, logger *slog.Logger) domain.IPFSRepository
- type AddResponse
- type IPFSRepo
- func (r *IPFSRepo) AddViaFile(file *os.File, shouldPin bool) (string, error)
- func (r *IPFSRepo) AddViaFileContent(fileContent []byte, shouldPin bool) (string, error)
- func (r *IPFSRepo) AddViaFilePath(fullFilePath string, shouldPin bool) (string, error)
- func (r *IPFSRepo) AddViaReaderFile(node files.File, shouldPin bool) (string, error)
- func (s *IPFSRepo) Get(ctx context.Context, cidString string) ([]byte, string, error)
- func (r *IPFSRepo) ID() (peer.ID, error)
- func (impl *IPFSRepo) Pin(cidString string) error
- func (r *IPFSRepo) PinAddViaFilePath(fullFilePath string) (string, error)
- type IPFSRepoConfigurationProvider
- type IPFSRepoConfigurationProviderImpl
- type PinObjectRepo
- func (r *PinObjectRepo) CommitTransaction() error
- func (r *PinObjectRepo) DeleteByCID(cid string) error
- func (r *PinObjectRepo) DeleteByRequestID(requestID uint64) error
- func (r *PinObjectRepo) DiscardTransaction()
- func (r *PinObjectRepo) GetByCID(cid string) (*domain.PinObject, error)
- func (r *PinObjectRepo) GetByRequestID(requestID uint64) (*domain.PinObject, error)
- func (r *PinObjectRepo) ListAll() ([]*domain.PinObject, error)
- func (r *PinObjectRepo) OpenTransaction() error
- func (r *PinObjectRepo) Upsert(pinobj *domain.PinObject) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIPFSRepo ¶
func NewIPFSRepo(cfg IPFSRepoConfigurationProvider, logger *slog.Logger) domain.IPFSRepository
NewIPFSRepo returns a new IPFSNode instance
Types ¶
type AddResponse ¶
type AddResponse struct { Bytes int64 `json:"Bytes"` Hash string `json:"Hash"` Mode string `json:"Mode"` Mtime int64 `json:"Mtime"` MtimeNsecs int `json:"MtimeNsecs"` Name string `json:"Name"` Size string `json:"Size"` }
AddResponse represents the response from the /api/v0/add endpoint
type IPFSRepo ¶
type IPFSRepo struct {
// contains filtered or unexported fields
}
func (*IPFSRepo) AddViaFile ¶
func (*IPFSRepo) AddViaFileContent ¶
func (*IPFSRepo) AddViaFilePath ¶
func (*IPFSRepo) AddViaReaderFile ¶
type IPFSRepoConfigurationProvider ¶
type IPFSRepoConfigurationProvider interface { GetIPFSNodeRemoteIP() string // Retrieves the remote or local IPFS service remote IP. GetIPFSNodeRemotePort() string // Retrieves the remote or local IPFS service remote port. GetPublicIPFSGatewayAddress() string // Retrieves a publically accessible IPFS gateway address. }
IPFSRepoConfigurationProvider is an interface for configuration providers that provide all needed settings to connect to an IPFS node either remote or a local IPFS node.
func NewIPFSRepoConfigurationProvider ¶
func NewIPFSRepoConfigurationProvider(remoteIP, remotePort, publicGatewayAddress string) IPFSRepoConfigurationProvider
NewIPFSRepoConfigurationProvider constructs a new configuration provider for IPFS connections.
type IPFSRepoConfigurationProviderImpl ¶
type IPFSRepoConfigurationProviderImpl struct {
// contains filtered or unexported fields
}
IPFSRepoConfigurationProviderImpl is a struct that implements IPFSRepoConfigurationProvider for storing IPFS connection details.
func (*IPFSRepoConfigurationProviderImpl) GetIPFSNodeRemoteIP ¶
func (impl *IPFSRepoConfigurationProviderImpl) GetIPFSNodeRemoteIP() string
func (*IPFSRepoConfigurationProviderImpl) GetIPFSNodeRemotePort ¶
func (impl *IPFSRepoConfigurationProviderImpl) GetIPFSNodeRemotePort() string
func (*IPFSRepoConfigurationProviderImpl) GetPublicIPFSGatewayAddress ¶
func (impl *IPFSRepoConfigurationProviderImpl) GetPublicIPFSGatewayAddress() string
type PinObjectRepo ¶
type PinObjectRepo struct {
// contains filtered or unexported fields
}
func NewPinObjectRepo ¶
func (*PinObjectRepo) CommitTransaction ¶
func (r *PinObjectRepo) CommitTransaction() error
func (*PinObjectRepo) DeleteByCID ¶
func (r *PinObjectRepo) DeleteByCID(cid string) error
func (*PinObjectRepo) DeleteByRequestID ¶
func (r *PinObjectRepo) DeleteByRequestID(requestID uint64) error
func (*PinObjectRepo) DiscardTransaction ¶
func (r *PinObjectRepo) DiscardTransaction()
func (*PinObjectRepo) GetByCID ¶
func (r *PinObjectRepo) GetByCID(cid string) (*domain.PinObject, error)
func (*PinObjectRepo) GetByRequestID ¶
func (r *PinObjectRepo) GetByRequestID(requestID uint64) (*domain.PinObject, error)
func (*PinObjectRepo) OpenTransaction ¶
func (r *PinObjectRepo) OpenTransaction() error
Click to show internal directories.
Click to hide internal directories.