p2p

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: AGPL-3.0 Imports: 59 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DirextalkRoomTypeDirect  = productpolicy.DirextalkRoomTypeDirect
	DirextalkRoomTypeGroup   = productpolicy.DirextalkRoomTypeGroup
	DirextalkRoomTypeChannel = productpolicy.DirextalkRoomTypeChannel
	DirextalkRoomTypeSystem  = "io.dirextalk.room.system"

	DirextalkRoomProfileEventType  = productpolicy.DirextalkRoomProfileEventType
	DirextalkMemberPolicyEventType = productpolicy.DirextalkMemberPolicyEventType
	DirextalkJoinRequestEventType  = productpolicy.DirextalkJoinRequestEventType

	DirextalkAgentStatusEventType = "io.dirextalk.agent.status"
	AgentGatewayContentKey        = "io.dirextalk.agent_gateway"
	AgentGatewaySourceContentKey  = "io.dirextalk.gateway_source"
)
View Source
const PathPrefix = "/_p2p/"

Variables

This section is empty.

Functions

func Register

func Register(router *mux.Router, service *Service)

func RegisterMCP

func RegisterMCP(router *mux.Router, service *Service)

func RegisterWellKnown

func RegisterWellKnown(router *mux.Router, service *Service)

Types

type AccountDeactivator

type AccountDeactivator interface {
	DeactivateAccount(ctx context.Context, localpart string) error
}

type AccountDeprovisioner

type AccountDeprovisioner interface {
	DeprovisionAccount(ctx context.Context) error
}

type CompositeMatrixHistoryReader

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

func NewCompositeMatrixHistoryReader

func NewCompositeMatrixHistoryReader(messages MatrixHistoryReader, channelContent MatrixChannelContentReader) *CompositeMatrixHistoryReader

func (*CompositeMatrixHistoryReader) ListChannelContent

func (r *CompositeMatrixHistoryReader) ListChannelContent(ctx context.Context, roomID string, limit int) ([]matrixhistory.Event, error)

func (*CompositeMatrixHistoryReader) ListOrdinaryMessages

type Config

type Config struct {
	ServerName                      string
	Homeserver                      string
	RemoteNodeInsecureSkipTLSVerify bool
	RemoteNodeAllowPrivateBaseURLs  bool
	P2PEventRetentionMaxRows        int64
	P2PEventRetentionPruneOnWrite   bool
	PushRules                       PushRuleManager
	RealtimeSessions                *realtime.SessionStore
	PluginRunner                    PluginRunner
	NativeAgentRunner               NativeAgentRunner
	NativeAgentDataDir              string
	ReleaseController               releasecontrol.Controller
}

type DatabaseStore

type DatabaseStore = p2pstorage.DatabaseStore

func NewDatabaseStore

func NewDatabaseStore(ctx context.Context, cm *sqlutil.Connections, dbProperties *config.DatabaseOptions) (*DatabaseStore, error)

func NewUnmigratedDatabaseStore

func NewUnmigratedDatabaseStore(db *sql.DB, writer sqlutil.Writer) *DatabaseStore

type DendriteMatrixSessionIssuer

type DendriteMatrixSessionIssuer = dirextalksession.Issuer

func NewDendriteAccountDeactivator

func NewDendriteAccountDeactivator(userAPI userapi.UserInternalAPI, serverName spec.ServerName) *DendriteMatrixSessionIssuer

func NewDendriteMatrixSessionIssuer

func NewDendriteMatrixSessionIssuer(userAPI userapi.UserInternalAPI, serverName spec.ServerName) *DendriteMatrixSessionIssuer

type DendriteTransport

type DendriteTransport = dendrite.DendriteTransport

type HTTPMatrixHistoryReader

type HTTPMatrixHistoryReader = matrixhistory.HTTPMessageReader

func NewHTTPMatrixHistoryReader

func NewHTTPMatrixHistoryReader(baseURL string, token func(context.Context) (string, error), client *http.Client) *HTTPMatrixHistoryReader

type HTTPMatrixProfileResolver

type HTTPMatrixProfileResolver = dirextalkmatrix.HTTPProfileResolver

func NewHTTPMatrixProfileResolver

func NewHTTPMatrixProfileResolver(baseURL string, client *http.Client) *HTTPMatrixProfileResolver

type JoinRoomResult

type JoinRoomResult = dirextalktransport.JoinRoomResult

type MatrixChannelContentReader

type MatrixChannelContentReader interface {
	ListChannelContent(ctx context.Context, roomID string, limit int) ([]matrixhistory.Event, error)
}

type MatrixHistoryReader

type MatrixHistoryReader interface {
	ListOrdinaryMessages(ctx context.Context, roomID string, page matrixhistory.Page) (matrixhistory.MessagePageResult, error)
}

type MatrixProfileUpdater

type MatrixProfileUpdater interface {
	UpdateMatrixProfile(ctx context.Context, userID, displayName, avatarURL string) error
}

type MatrixSessionIssuer

type MatrixSessionIssuer interface {
	EnsureMatrixSession(ctx context.Context, userID, displayName, avatarURL, deviceID string, revokeExistingDevices bool) (string, error)
}

type NativeAgentRunner

type NativeAgentRunner interface {
	Apply(ctx context.Context, action string) error
	Invoke(ctx context.Context, action string, params map[string]any) (map[string]any, error)
	Stream(ctx context.Context, action string, params map[string]any, emit func(nativeagent.Event) error) error
}

type OutputRoomEventConsumer

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

func NewOutputRoomEventConsumer

func NewOutputRoomEventConsumer(process *process.ProcessContext, cfg *config.JetStream, js nats.JetStreamContext, service *Service) *OutputRoomEventConsumer

func (*OutputRoomEventConsumer) Start

func (c *OutputRoomEventConsumer) Start() error

type PluginInvokeRequest

type PluginInvokeRequest struct {
	PluginID      string
	ContainerName string
	Action        string
	Params        map[string]any
}

type PluginRunner

type PluginRunner interface {
	ApplyPlugin(ctx context.Context, op PluginRunnerOperation) error
	InvokePlugin(ctx context.Context, req PluginInvokeRequest) (map[string]any, error)
	StreamPlugin(ctx context.Context, req PluginInvokeRequest, emit func(PluginStreamEvent) error) error
}

type PluginRunnerOperation

type PluginRunnerOperation struct {
	Action        string
	PluginID      string
	Name          string
	Version       string
	Image         string
	Digest        string
	ContainerName string
	Network       string
	Config        map[string]any
	Env           map[string]string
	Volumes       []string
}

type PluginStreamEvent

type PluginStreamEvent struct {
	Event string
	Data  map[string]any
}

type PushRuleManager

type PushRuleManager interface {
	QueryPushRules(ctx context.Context, userID string) (*pushrules.AccountRuleSets, error)
	PerformPushRulesPut(ctx context.Context, userID string, ruleSets *pushrules.AccountRuleSets) error
}

type RoomChannel

type RoomChannel = dirextalktransport.RoomChannel

type RoomMember

type RoomMember = dirextalktransport.RoomMember

type RoomStateEvent

type RoomStateEvent = dirextalktransport.RoomStateEvent

type Service

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

func NewService

func NewService(cfg Config) *Service

func NewServiceWithStore

func NewServiceWithStore(ctx context.Context, cfg Config, store Store) (*Service, error)

func NewServiceWithStoreAndTransport

func NewServiceWithStoreAndTransport(ctx context.Context, cfg Config, store Store, transport Transport) (*Service, error)

func NewServiceWithTransport

func NewServiceWithTransport(cfg Config, transport Transport) *Service

func (*Service) AccessToken

func (s *Service) AccessToken() string

func (*Service) AgentToken

func (s *Service) AgentToken() string

func (*Service) Authenticate

func (s *Service) Authenticate(token string) bool

func (*Service) Authorize

func (s *Service) Authorize(token, action string) bool

func (*Service) Handle

func (s *Service) Handle(ctx context.Context, action string, params map[string]any) (any, *apiError)

func (*Service) MatrixHistoryAccessToken

func (s *Service) MatrixHistoryAccessToken(ctx context.Context) (string, error)

func (*Service) OwnerMXID

func (s *Service) OwnerMXID() string

func (*Service) ProjectOutputEvent

func (s *Service) ProjectOutputEvent(ctx context.Context, output roomserverAPI.OutputEvent) error

func (*Service) ProjectRoomEvent

func (s *Service) ProjectRoomEvent(ctx context.Context, event *types.HeaderedEvent) error

func (*Service) SetAccountDeactivator

func (s *Service) SetAccountDeactivator(deactivator AccountDeactivator)

func (*Service) SetAccountDeprovisioner

func (s *Service) SetAccountDeprovisioner(deprovisioner AccountDeprovisioner)

func (*Service) SetMatrixMessageReader

func (s *Service) SetMatrixMessageReader(reader matrixMessageReader)

func (*Service) SetMatrixProfileResolver

func (s *Service) SetMatrixProfileResolver(resolver matrixProfileResolver)

func (*Service) SetMatrixSessionIssuer

func (s *Service) SetMatrixSessionIssuer(issuer MatrixSessionIssuer)

func (*Service) SetProjectorStarted

func (s *Service) SetProjectorStarted(started bool)

func (*Service) SetPushRuleManager

func (s *Service) SetPushRuleManager(manager PushRuleManager)

type Store

type Store interface {
	// contains filtered or unexported methods
}

type Transport

type Transport = dirextalktransport.Transport

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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