Documentation ¶
Index ¶
- Constants
- func DownloadDag(ctx context.Context, connectionManager ConnectionManager, connectionID string, ...) (context.Context, *merkle_dag.Dag, error)
- func QueryDag(ctx context.Context, connectionManager ConnectionManager, connectionID string, ...) (context.Context, *[]string, error)
- func QueryEvents(ctx context.Context, connectionManager ConnectionManager, connectionID string, ...) ([]nostr.Event, error)
- func ReadJsonMessageFromStream[T any](stream types.Stream) (*T, error)
- func ReadMessageFromStream[T any](stream types.Stream) (*T, error)
- func SendUniversalEvent(ctx context.Context, connectionManager ConnectionManager, event *nostr.Event, ...) (map[string]*nostr.OKEnvelope, error)
- func SendUniversalEventSingle(ctx context.Context, connectionManager ConnectionManager, connectionID string, ...) (*nostr.OKEnvelope, error)
- func SetupConnection(useLibp2p bool, address string) (types.Connector, error)
- func UploadDag(ctx context.Context, connectionManager ConnectionManager, dag *merkle_dag.Dag, ...) error
- func UploadDagSingle(ctx context.Context, connectionManager ConnectionManager, connectionID string, ...) error
- func WaitForResponse(ctx context.Context, stream types.Stream) bool
- func WaitForUploadMessage(ctx context.Context, stream types.Stream) (bool, *types.UploadMessage)
- func WriteJsonMessageToStream[T any](stream types.Stream, message T) error
- func WriteMessageToStream[T any](stream types.Stream, message T) error
- func WriteResponseToStream(ctx context.Context, stream types.Stream, response bool) error
- type ConnectionManager
- type GenericConnectionManager
- func (gcm *GenericConnectionManager) ConnectWithLibp2p(ctx context.Context, connectionId string, serverAddress string, ...) error
- func (gcm *GenericConnectionManager) ConnectWithWebsocket(ctx context.Context, connectionId string, url string) error
- func (gcm *GenericConnectionManager) Disconnect(connectionID string) error
- func (gcm *GenericConnectionManager) GetStream(ctx context.Context, connectionID string, protocolID string) (types.Stream, error)
- func (gcm *GenericConnectionManager) ListConnections() map[string]types.Connector
Constants ¶
View Source
const ( UploadID string = "/upload" DownloadID string = "/download" QueryID string = "/query" )
Variables ¶
This section is empty.
Functions ¶
func DownloadDag ¶
func DownloadDag(ctx context.Context, connectionManager ConnectionManager, connectionID string, root string, publicKey *string, signature *string, filter *types.DownloadFilter, progressChan chan<- types.DownloadProgress) (context.Context, *merkle_dag.Dag, error)
func QueryEvents ¶
func SendUniversalEvent ¶
func SetupConnection ¶
func UploadDag ¶
func UploadDag(ctx context.Context, connectionManager ConnectionManager, dag *merkle_dag.Dag, publicKey *string, signature *string, progressChan chan<- types.UploadProgress) error
func UploadDagSingle ¶
func UploadDagSingle(ctx context.Context, connectionManager ConnectionManager, connectionID string, dag *merkle_dag.Dag, publicKey *string, signature *string, progressChan chan<- types.UploadProgress) error
func WaitForUploadMessage ¶
Types ¶
type ConnectionManager ¶
type ConnectionManager interface { ConnectWithLibp2p(ctx context.Context, connectionId string, serverAddress string, opts ...libp2p.Option) error ConnectWithWebsocket(ctx context.Context, connectionId string, url string) error Disconnect(connectionID string) error GetStream(ctx context.Context, connectionID string, protocolID string) (types.Stream, error) ListConnections() map[string]types.Connector }
type GenericConnectionManager ¶
type GenericConnectionManager struct {
// contains filtered or unexported fields
}
func NewGenericConnectionManager ¶
func NewGenericConnectionManager() *GenericConnectionManager
func (*GenericConnectionManager) ConnectWithLibp2p ¶
func (*GenericConnectionManager) ConnectWithWebsocket ¶
func (*GenericConnectionManager) Disconnect ¶
func (gcm *GenericConnectionManager) Disconnect(connectionID string) error
func (*GenericConnectionManager) ListConnections ¶
func (gcm *GenericConnectionManager) ListConnections() map[string]types.Connector
Source Files ¶
Click to show internal directories.
Click to hide internal directories.