Documentation ¶
Overview ¶
this package contains ipfs helper functions
this package contains ipfs helper functions
this package contains ipfs helper functions
Index ¶
- func AddBytes(node iface.CoreAPI, msg []byte) (cid.Cid, error)
- func AddFsFile(node iface.CoreAPI, path string) (path.Resolved, error)
- func AddProtobufFile(node iface.CoreAPI, msg proto.Message) (cid.Cid, error)
- func DecryptSecret(secret *pb.Volume_SecretConfig, contents []byte) ([]byte, error)
- func DownloadSecret(ctx context.Context, ipfs iface.CoreAPI, secret *pb.Volume_SecretConfig) ([]byte, error)
- func EncryptSecret(data []byte) (key *pb.Key, contents []byte, err error)
- func GetBytes(node iface.CoreAPI, cid cid.Cid) ([]byte, error)
- func GetFsFile(node iface.CoreAPI, file files.Node, path path.Path, savePath string) error
- func GetImageRef(ctx context.Context, sys *types.SystemContext, image *pb.Container_Image) (imageRef types.ImageReference, digest string, err error)
- func GetIpfsClient(ipfsApi string) (api *rpc.HttpApi, apiMultiaddr multiaddr.Multiaddr, err error)
- func GetProtobufFile(node iface.CoreAPI, cid cid.Cid, msg proto.Message) error
- func GetRefUrl(imageRef types.ImageReference) string
- func ReadSecret(basepath string, secret *pb.Volume_SecretConfig) ([]byte, error)
- func RemoveSecret(ctx context.Context, ipfs iface.CoreAPI, cidBytes []byte) error
- func ReuploadImageFromIpdr(ctx context.Context, ipfs iface.CoreAPI, localRegistryUrl string, ...) (types.ImageReference, error)
- func TransformSecrets(pod *pb.Pod, transformations ...SecretTransformation) error
- func UploadImageToIpdr(ctx context.Context, ipfs iface.CoreAPI, sys *types.SystemContext, ...) (key *pb.Key, imageCid []byte, err error)
- func UploadSecret(ctx context.Context, ipfs iface.CoreAPI, contents []byte) (cid []byte, err error)
- type ExistingOption
- type ExposedEndpoint
- type ForwardedConnection
- type IpfsAddr
- type IpfsListener
- type P2PListenerInfoOutput
- type P2PLsOutput
- type P2pApi
- func (api *P2pApi) Connect(protocol string, target multiaddr.Multiaddr) (*IpfsAddr, error)
- func (api *P2pApi) ConnectTo(protocol string, target peer.ID) (*IpfsAddr, error)
- func (api *P2pApi) ExposeEndpoint(protocol string, endpoint multiaddr.Multiaddr, existing ExistingOption) (*ExposedEndpoint, error)
- func (api *P2pApi) ForwardConnection(protocol string, endpoint multiaddr.Multiaddr, target multiaddr.Multiaddr) (*ForwardedConnection, error)
- func (api *P2pApi) Listen(protocol string) (*IpfsListener, error)
- type SecretTransformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddProtobufFile ¶
Adds a file from a protobuf slice to IPFS
func DecryptSecret ¶
func DecryptSecret(secret *pb.Volume_SecretConfig, contents []byte) ([]byte, error)
func DownloadSecret ¶
func GetFsFile ¶
Saves an IPFS file or directory represented by the given files.Node to the specified local file system path.
func GetImageRef ¶
func GetImageRef(ctx context.Context, sys *types.SystemContext, image *pb.Container_Image) (imageRef types.ImageReference, digest string, err error)
func GetIpfsClient ¶
func GetProtobufFile ¶
func GetRefUrl ¶
func GetRefUrl(imageRef types.ImageReference) string
func ReadSecret ¶
func ReadSecret(basepath string, secret *pb.Volume_SecretConfig) ([]byte, error)
func RemoveSecret ¶
func ReuploadImageFromIpdr ¶
func ReuploadImageFromIpdr(ctx context.Context, ipfs iface.CoreAPI, localRegistryUrl string, sys *types.SystemContext, image *pb.Container_Image) (types.ImageReference, error)
func TransformSecrets ¶
func TransformSecrets(pod *pb.Pod, transformations ...SecretTransformation) error
func UploadImageToIpdr ¶
Types ¶
type ExistingOption ¶
type ExistingOption int
const ( ConflictExistingEndpoint ExistingOption = 0 ReturnExistingEndpoint ExistingOption = 1 )
type ExposedEndpoint ¶
type ExposedEndpoint struct { P2PListenerInfoOutput // contains filtered or unexported fields }
func (*ExposedEndpoint) Close ¶
func (i *ExposedEndpoint) Close() error
type ForwardedConnection ¶
type ForwardedConnection struct { P2PListenerInfoOutput // contains filtered or unexported fields }
func (*ForwardedConnection) Close ¶
func (f *ForwardedConnection) Close() error
type IpfsAddr ¶
type IpfsAddr struct { net.Addr *ForwardedConnection }
type IpfsListener ¶
type IpfsListener struct { net.Listener *ExposedEndpoint }
func (*IpfsListener) Close ¶
func (l *IpfsListener) Close() error
type P2PListenerInfoOutput ¶
type P2PLsOutput ¶
type P2PLsOutput struct {
Listeners []P2PListenerInfoOutput
}
type P2pApi ¶
type P2pApi struct {
// contains filtered or unexported fields
}
func (*P2pApi) ExposeEndpoint ¶
func (api *P2pApi) ExposeEndpoint(protocol string, endpoint multiaddr.Multiaddr, existing ExistingOption) (*ExposedEndpoint, error)
func (*P2pApi) ForwardConnection ¶
func (api *P2pApi) ForwardConnection(protocol string, endpoint multiaddr.Multiaddr, target multiaddr.Multiaddr) (*ForwardedConnection, error)
type SecretTransformation ¶
type SecretTransformation func(secret *pb.Volume_SecretConfig) error
Click to show internal directories.
Click to hide internal directories.