Documentation ¶
Index ¶
- Constants
- Variables
- func Addr2ID(x addr.Addr) routing_table.ID
- func Addrs2IDs(xs []Addr) (ys []routing_table.ID)
- func ContainAddr(xs []Addr, t Addr) bool
- func ConvertChannelStateToEventName(st meepo_interface.ChannelState) string
- func ConvertTransportStateToEventName(st meepo_interface.TransportState) string
- func ErrRequireProtocolVersionBetweenFn(from, to string) error
- func ID2Addr(x routing_table.ID) addr.Addr
- func IDs2Addrs(xs []routing_table.ID) (ys []addr.Addr)
- func NewMeepo(opts ...NewMeepoOption) (meepo_interface.Meepo, error)
- func RequireProtocolVersion[IT, OT any](from string, to string) rpc_core.Middleware[IT, OT]
- func ViewChannel(c Channel) sdk_interface.ChannelView
- func ViewChannelWithAddr(c Channel, target addr.Addr) sdk_interface.ChannelView
- func ViewChannelsWithAddr(cs []Channel, target addr.Addr) (cvs []sdk_interface.ChannelView)
- func ViewTeleportation(tp Teleportation) sdk_interface.TeleportationView
- func ViewTeleportations(tps []Teleportation) (tpvs []sdk_interface.TeleportationView)
- func ViewTransport(t Transport) sdk_interface.TransportView
- func ViewTransports(ts []Transport) (tvs []sdk_interface.TransportView)
- type AddPeerConnectionHandler
- type Addr
- type Channel
- type GetCandidatesRequest
- type GetCandidatesResponse
- type GetChannelOption
- type GetTeleportationOption
- type GetTransportOption
- type ListChannelsOption
- type ListTeleportationsOption
- type ListTransportsOption
- type Meepo
- func (mp *Meepo) Addr() Addr
- func (mp *Meepo) AsAPIHandler() rpc_interface.Handler
- func (mp *Meepo) AsTrackerdHandler() rpc_interface.Handler
- func (mp *Meepo) Close(ctx context.Context) error
- func (mp *Meepo) Diagnostic(ctx context.Context) (meepo_interface.DiagnosticReport, error)
- func (mp *Meepo) GetChannel(ctx context.Context, target Addr, id uint16) (Channel, error)
- func (mp *Meepo) GetLogger() logging.Logger
- func (mp *Meepo) GetRawLogger() logging.Logger
- func (mp *Meepo) GetTeleportation(ctx context.Context, id string, opts ...GetTeleportationOption) (Teleportation, error)
- func (mp *Meepo) GetTransport(ctx context.Context, target Addr, opts ...GetTransportOption) (Transport, error)
- func (mp *Meepo) ListChannels(ctx context.Context, opts ...ListChannelsOption) (cm map[Addr][]Channel, err error)
- func (mp *Meepo) ListChannelsByTarget(ctx context.Context, target Addr, opts ...ListChannelsOption) ([]Channel, error)
- func (mp *Meepo) ListTeleportations(ctx context.Context, opts ...ListTeleportationsOption) (tps []Teleportation, err error)
- func (mp *Meepo) ListTransports(ctx context.Context, opts ...ListTransportsOption) (ts []Transport, err error)
- func (mp *Meepo) NewChannel(ctx context.Context, target Addr, network, address string, ...) (Channel, error)
- func (mp *Meepo) NewTeleportation(ctx context.Context, target Addr, ...) (Teleportation, error)
- func (mp *Meepo) NewTransport(ctx context.Context, target Addr, opts ...NewTransportOption) (Transport, error)
- func (mp *Meepo) Teleport(ctx context.Context, target Addr, ...) (Teleportation, error)
- func (mp *Meepo) WatchEvents(ctx context.Context, policies []string, ...) (chan meepo_interface.Event, error)
- type NaviRequest
- type NewChannelOption
- type NewMeepoOption
- type NewTeleportationOption
- type NewTransportOption
- type PermitRequest
- type PingRequest
- type PingResponse
- type TeleportOption
- type Teleportation
- type Tracker
- type Transport
Constants ¶
View Source
const ( WATCH_EVENTS_COMMAND_WATCH = "watch" WATCH_EVENTS_COMMAND_UNWATCH = "unwatch" WATCH_EVENTS_COMMAND_UNWATCH_ALL = "unwatchAll" )
View Source
const ( EVENT_TRANSPORT_ACTION_NEW = "mpo.transport.action.new" EVENT_TRANSPORT_ACTION_CLOSE = "mpo.transport.action.close" EVENT_CHANNEL_ACTION_NEW = "mpo.channel.action.new" EVENT_CHANNEL_ACTION_CLOSE = "mpo.channel.action.close" EVENT_TELEPORTATION_ACTION_NEW = "mpo.teleportation.action.new" EVENT_TELEPORTATION_ACTION_CLOSE = "mpo.teleportation.action.close" EVENT_TRANSPORT_STATE_NEW = "mpo.transport.state.new" EVENT_TRANSPORT_STATE_CONNECTING = "mpo.transport.state.connecting" EVENT_TRANSPORT_STATE_CONNECTED = "mpo.transport.state.connected" EVENT_TRANSPORT_STATE_DISCONNECTED = "mpo.transport.state.disconnected" EVENT_TRANSPORT_STATE_FAILED = "mpo.transport.state.failed" EVENT_TRANSPORT_STATE_CLOSED = "mpo.transport.state.closed" EVENT_CHANNEL_STATE_NEW = "mpo.channel.state.new" EVENT_CHANNEL_STATE_CONNECTING = "mpo.channel.state.connecting" EVENT_CHANNEL_STATE_OPEN = "mpo.channel.state.open" EVENT_CHANNEL_STATE_CLOSING = "mpo.channel.state.closing" EVENT_CHANNEL_STATE_CLOSED = "mpo.channel.state.closed" )
View Source
const ( OPTION_DHT_ALPHA = "dhtAlpha" OPTION_POOF_INTERVAL = "poofInterval" OPTION_POOF_REQUEST_CANDIDATES = "poofRequestCandidates" OPTION_ENABLE_POOF = "enablePoof" OPTION_MEEPO_DEBUG_INTERFACE = "meepoDebugInterface" OPTION_GET_TRACKERS_FUNC = "getTrackersFunc" OPTION_NAVI_REQUEST_QUEUE_TIMEOUT = "naviRequestQueueTimeout" METHOD_PING = "ping" METHOD_PERMIT = "permit" METHOD_ADD_PEER_CONNECTION = "addPeerConnection" )
Variables ¶
View Source
var (
ErrUnsupportedMethod, ErrUnsupportedMethodFn = errors.NewErrorAndErrorFunc[string]("unsupported method")
ErrTeleportationNotFound, ErrTeleportationNotFoundFn = errors.NewErrorAndErrorFunc[string]("teleportation not found")
ErrTransportNotFound, ErrTransportNotFoundFn = errors.NewErrorAndErrorFunc[string]("transport not found")
ErrTransportFound, ErrTransportFoundFn = errors.NewErrorAndErrorFunc[string]("transport found")
ErrTransportExist, ErrTransportExistFn = errors.NewErrorAndErrorFunc[string]("transport exist")
ErrTrackerNotFound, ErrTrackerNotFoundFn = errors.NewErrorAndErrorFunc[string]("tracker not found")
ErrInvalidNonce, ErrInvalidNonceFn = errors.NewErrorAndErrorFunc[uint32]("invalid nonce")
ErrRequireProtocolVersionBetween, ErrRequireProtocolVersionBetweenFn_ = errors.NewErrorAndErrorFunc[string]("require protocol version between")
)
View Source
var (
WithDHTAlpha, GetDHTAlpha = option.New[int](OPTION_DHT_ALPHA)
WithPoofInterval, GetPoofInterval = option.New[time.Duration](OPTION_POOF_INTERVAL)
WithPoofRequestCandidates, GetPoofRequestCandidates = option.New[int](OPTION_POOF_REQUEST_CANDIDATES)
WithEnablePoof, GetEnablePoof = option.New[bool](OPTION_ENABLE_POOF)
WithMeepoDebugInterface, GetMeepoDebugInterface = option.New[string](OPTION_MEEPO_DEBUG_INTERFACE)
WithGetTrackersFunc, GetGetTrackersFunc = option.New[getTrackersFunc](OPTION_GET_TRACKERS_FUNC)
View Source
var (
ErrNoAvailableTrackers = fmt.Errorf("no available trackers")
)
Functions ¶
func Addrs2IDs ¶
func Addrs2IDs(xs []Addr) (ys []routing_table.ID)
func ContainAddr ¶
func ConvertChannelStateToEventName ¶
func ConvertChannelStateToEventName(st meepo_interface.ChannelState) string
func ConvertTransportStateToEventName ¶
func ConvertTransportStateToEventName(st meepo_interface.TransportState) string
func NewMeepo ¶
func NewMeepo(opts ...NewMeepoOption) (meepo_interface.Meepo, error)
func RequireProtocolVersion ¶
func RequireProtocolVersion[IT, OT any](from string, to string) rpc_core.Middleware[IT, OT]
func ViewChannel ¶
func ViewChannel(c Channel) sdk_interface.ChannelView
func ViewChannelWithAddr ¶
func ViewChannelWithAddr(c Channel, target addr.Addr) sdk_interface.ChannelView
func ViewChannelsWithAddr ¶
func ViewChannelsWithAddr(cs []Channel, target addr.Addr) (cvs []sdk_interface.ChannelView)
func ViewTeleportation ¶
func ViewTeleportation(tp Teleportation) sdk_interface.TeleportationView
func ViewTeleportations ¶
func ViewTeleportations(tps []Teleportation) (tpvs []sdk_interface.TeleportationView)
func ViewTransport ¶
func ViewTransport(t Transport) sdk_interface.TransportView
func ViewTransports ¶
func ViewTransports(ts []Transport) (tvs []sdk_interface.TransportView)
Types ¶
type AddPeerConnectionHandler ¶
type AddPeerConnectionHandler interface {
OnAddPeerConnection(transport_webrtc.Session, webrtc.SessionDescription) (webrtc.SessionDescription, error)
}
type Addr ¶
type Addr = meepo_interface.Addr
type Channel ¶
type Channel = meepo_interface.Channel
type GetCandidatesRequest ¶
type GetCandidatesRequest = tracker_interface.GetCandidatesRequest
type GetCandidatesResponse ¶
type GetCandidatesResponse = tracker_interface.GetCandidatesResponse
type GetChannelOption ¶
type GetChannelOption = meepo_interface.GetChannelOption
type GetTeleportationOption ¶
type GetTeleportationOption = meepo_interface.GetTeleportationOption
type GetTransportOption ¶
type GetTransportOption = meepo_interface.GetTransportOption
type ListChannelsOption ¶
type ListChannelsOption = meepo_interface.ListChannelsOption
type ListTeleportationsOption ¶
type ListTeleportationsOption = meepo_interface.ListTeleportationsOption
type ListTransportsOption ¶
type ListTransportsOption = meepo_interface.ListTransportsOption
type Meepo ¶
type Meepo struct {
// contains filtered or unexported fields
}
func (*Meepo) AsAPIHandler ¶
func (mp *Meepo) AsAPIHandler() rpc_interface.Handler
func (*Meepo) AsTrackerdHandler ¶
func (mp *Meepo) AsTrackerdHandler() rpc_interface.Handler
func (*Meepo) Diagnostic ¶
func (mp *Meepo) Diagnostic(ctx context.Context) (meepo_interface.DiagnosticReport, error)
func (*Meepo) GetChannel ¶
func (*Meepo) GetRawLogger ¶
func (*Meepo) GetTeleportation ¶
func (mp *Meepo) GetTeleportation(ctx context.Context, id string, opts ...GetTeleportationOption) (Teleportation, error)
func (*Meepo) GetTransport ¶
func (*Meepo) ListChannels ¶
func (*Meepo) ListChannelsByTarget ¶
func (*Meepo) ListTeleportations ¶
func (mp *Meepo) ListTeleportations(ctx context.Context, opts ...ListTeleportationsOption) (tps []Teleportation, err error)
func (*Meepo) ListTransports ¶
func (*Meepo) NewChannel ¶
func (*Meepo) NewTeleportation ¶
func (mp *Meepo) NewTeleportation(ctx context.Context, target Addr, sourceNetwork, sourceAddress, sinkNetwork, sinkAddress string, opts ...NewTeleportationOption) (Teleportation, error)
func (*Meepo) NewTransport ¶
func (*Meepo) Teleport ¶
func (mp *Meepo) Teleport(ctx context.Context, target Addr, sourceNetwork, sourceAddress, sinkNetwork, sinkAddress string, opts ...TeleportOption) (Teleportation, error)
func (*Meepo) WatchEvents ¶
func (mp *Meepo) WatchEvents(ctx context.Context, policies []string, opts ...meepo_interface.WatchEventsOption) (chan meepo_interface.Event, error)
type NaviRequest ¶
type NaviRequest struct {}
type NewChannelOption ¶
type NewChannelOption = meepo_interface.NewChannelOption
type NewMeepoOption ¶
type NewMeepoOption = option.ApplyOption
type NewTeleportationOption ¶
type NewTeleportationOption = meepo_interface.NewTeleportationOption
type NewTransportOption ¶
type NewTransportOption = meepo_interface.NewTransportOption
type PermitRequest ¶
type PingRequest ¶
type PingRequest struct {
Nonce uint32
}
type PingResponse ¶
type PingResponse struct {
Nonce uint32
}
type TeleportOption ¶
type TeleportOption = meepo_interface.TeleportOption
type Teleportation ¶
type Teleportation = meepo_interface.Teleportation
type Tracker ¶
type Tracker = tracker_interface.Tracker
type Transport ¶
type Transport = meepo_interface.Transport
Source Files ¶
- add_peer_connection.go
- addr.go
- api_close_channel.go
- api_close_teleportation.go
- api_close_transport.go
- api_diagnostic.go
- api_get_channel.go
- api_get_teleportation.go
- api_get_transport.go
- api_get_version.go
- api_list_channels.go
- api_list_channels_by_target.go
- api_list_teleportations.go
- api_list_transports.go
- api_new_teleportation.go
- api_new_transport.go
- api_ping.go
- api_teleport.go
- api_watch_events.go
- api_whoami.go
- as_handler.go
- before_new_channel_hook.go
- close.go
- context.go
- crypto.go
- diagnostic.go
- emit.go
- enable_meepo_debug_interface.go
- error.go
- events.go
- exist_transport.go
- forward_request.go
- get_channel.go
- get_closer_trackers.go
- get_closest_trackers.go
- get_teleportation.go
- get_tracker.go
- get_transport.go
- helper.go
- list_channels.go
- list_channels_by_target.go
- list_teleportations.go
- list_trackers.go
- list_transports.go
- logger.go
- meepo.go
- middleware_require_protocol_version.go
- navi.go
- navi_loop.go
- navi_once.go
- new_channel.go
- new_peer_connection.go
- new_teleportation.go
- new_transport.go
- on_add_peer_connection.go
- on_add_transport.go
- on_get_candidates.go
- on_new_transport.go
- on_permit.go
- on_ping.go
- on_ready_transport.go
- on_remove_transport.go
- on_teleportation_accept.go
- on_teleportation_close.go
- on_teleportation_new.go
- option.go
- poof.go
- poof_loop.go
- poof_once.go
- teleport.go
- tracker.go
- transport.go
- watch_events.go
- webrtc_nojs.go
- webrtc_transport_gather.go
Click to show internal directories.
Click to hide internal directories.