member

package
v0.2.433 Latest Latest
Warning

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

Go to latest
Published: May 14, 2025 License: GPL-2.0, GPL-3.0 Imports: 23 Imported by: ? modules, 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

type AuthProvider interface {
	GetOwner() domain.Owner
	SessionToken() string
}

type ClientNodeStreamer

type ClientNodeStreamer interface {
	ClientStream(nodeId string, path string, data any) (_ []byte, err error)
}

type ConsensusProvider

type ConsensusProvider interface {
	Start(node consensus.NodeTransporter) (err error)
	LeaderID() warpnet.WarpPeerID
	CommitState(newState consensus.KVState) (_ *consensus.KVState, err error)
	Shutdown()
	AskUserValidation(user domain.User) error
	Stats() map[string]string
}

type ConsensusStorer

type ConsensusStorer interface {
	Reset() error
}

type DiscoveryHandler

type DiscoveryHandler interface {
	HandlePeerFound(pi warpnet.PeerAddrInfo)
	Run(n discovery.DiscoveryInfoStorer) error
	Close()
}

type DistributedHashTableCloser

type DistributedHashTableCloser interface {
	Close()
}

type FollowStorer

type FollowStorer interface {
	GetFollowersCount(userId string) (uint64, error)
	GetFolloweesCount(userId string) (uint64, error)
	Follow(fromUserId, toUserId string, event domain.Following) error
	Unfollow(fromUserId, toUserId string) error
	GetFollowers(userId string, limit *uint64, cursor *string) ([]domain.Following, string, error)
	GetFollowees(userId string, limit *uint64, cursor *string) ([]domain.Following, string, error)
}

type MDNSStarterCloser

type MDNSStarterCloser interface {
	Start(n mdns.NodeConnector)
	Close()
}

type MemberNode

type MemberNode struct {
	*base.WarpNode
	// contains filtered or unexported fields
}

func NewMemberNode

func NewMemberNode(
	ctx context.Context,
	privKey warpnet.WarpPrivateKey,
	psk security.PSK,
	authRepo AuthProvider,
	db Storer,
) (_ *MemberNode, err error)

func (*MemberNode) GenericStream

func (m *MemberNode) GenericStream(nodeIdStr streamNodeID, path stream.WarpRoute, data any) (_ []byte, err error)

func (*MemberNode) Start

func (m *MemberNode) Start(clientNode ClientNodeStreamer) error

func (*MemberNode) Stop

func (m *MemberNode) Stop()

type ProviderCloser added in v0.2.413

type ProviderCloser interface {
	io.Closer
}

type PubSubProvider

type PubSubProvider interface {
	SubscribeUserUpdate(userId string) (err error)
	UnsubscribeUserUpdate(userId string) (err error)
	Run(m pubsub.PubsubServerNodeConnector, clientNode pubsub.PubsubClientNodeStreamer)
	PublishOwnerUpdate(ownerId string, msg event.Message) (err error)
	Close() error
}

type Storer

type Storer interface {
	NewWriteTxn() (storage.WarpTxWriter, error)
	NewReadTxn() (storage.WarpTxReader, error)
	Get(key storage.DatabaseKey) ([]byte, error)
	GetExpiration(key storage.DatabaseKey) (uint64, error)
	GetSize(key storage.DatabaseKey) (int64, error)
	Sync() error
	IsClosed() bool
	InnerDB() *storage.WarpDB
	SetWithTTL(key storage.DatabaseKey, value []byte, ttl time.Duration) error
	Set(key storage.DatabaseKey, value []byte) error
	Delete(key storage.DatabaseKey) error
	Path() string
	Stats() map[string]string
	IsFirstRun() bool
}

type UserFetcher

type UserFetcher interface {
	Get(userId string) (user domain.User, err error)
	Update(userId string, newUser domain.User) (domain.User, error)
	GetByNodeID(nodeID string) (user domain.User, err error)
}

type UserProvider

type UserProvider interface {
	Create(user domain.User) (domain.User, error)
	ValidateUser(k, v string) error
	GetByNodeID(nodeID string) (user domain.User, err error)
	Get(userId string) (user domain.User, err error)
	List(limit *uint64, cursor *string) ([]domain.User, string, error)
	Update(userId string, newUser domain.User) (updatedUser domain.User, err error)
	GetBatch(userIds ...string) (users []domain.User, err error)
}

Jump to

Keyboard shortcuts

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