Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AddressSalt = []byte("directory") ConfigSalt = []byte("directory:config") EventSwarmSalt = []byte("directory:events") AssetSwarmSalt = []byte("directory:assets") )
View Source
var ( ErrListingNotFound = errors.New("listing not found") ErrSessionNotFound = errors.New("session not found") ErrUserNotFound = errors.New("user not found") )
errors
View Source
var (
ErrNetworkNotFound = errors.New("network not found")
)
errors ...
Functions ¶
This section is empty.
Types ¶
type AssetBundleEvent ¶
type AssetBundleEvent struct { NetworkID uint64 NetworkKey []byte AssetBundle *networkv1directory.AssetBundle }
type Control ¶
type Control interface { Run() PushSnippet(swarmID ppspp.SwarmID, snippet *networkv1directory.ListingSnippet) DeleteSnippet(swarmID ppspp.SwarmID) Publish(ctx context.Context, listing *networkv1directory.Listing, networkKey []byte) (uint64, error) Unpublish(ctx context.Context, id uint64, networkKey []byte) error Join(ctx context.Context, query *networkv1directory.ListingQuery, networkKey []byte) (uint64, error) Part(ctx context.Context, id uint64, networkKey []byte) error ModerateListing(ctx context.Context, id uint64, moderation *networkv1directory.ListingModeration, networkKey []byte) error ModerateUser(ctx context.Context, peerKey []byte, moderation *networkv1directory.UserModeration, networkKey []byte) error GetListingsByPeerKey(peerKey []byte) []NetworkListings GetUsersByNetworkID(id uint64) []User GetListingsByNetworkID(id uint64) []Listing GetListingByQuery(networkID uint64, query *networkv1directory.ListingQuery) (Listing, bool) NotifyListingEvent(networkID uint64, ch chan ListingEvent) ([]Listing, error) StopNotifyingListingEvent(networkID uint64, ch chan ListingEvent) NotifyListingUserEvent(networkID, listingID uint64, ch chan UserEvent) ([]User, error) StopNotifyingListingUserEvent(networkID, listingID uint64, ch chan UserEvent) WatchAssetBundles(ctx context.Context) <-chan AssetBundleEvent }
type Listing ¶
type Listing struct { ID uint64 Listing *networkv1directory.Listing Snippet *networkv1directory.ListingSnippet Moderation *networkv1directory.ListingModeration UserCount uint32 RecentUserCount uint32 }
func (Listing) MarshalLogObject ¶
func (l Listing) MarshalLogObject(e zapcore.ObjectEncoder) error
type ListingEvent ¶
type ListingEvent struct { Type ListingEventType Listing Listing }
type ListingEventType ¶
type ListingEventType int
const ( ChangeListingEventType ListingEventType UnpublishListingEventType UserCountChangeListingEventType )
type NetworkListings ¶
type User ¶
func (User) MarshalLogObject ¶
func (u User) MarshalLogObject(e zapcore.ObjectEncoder) error
type UserEvent ¶
type UserEvent struct { Type UserEventType User User Listing Listing }
type UserEventType ¶
type UserEventType int
const ( JoinUserEventType UserEventType PartUserEventType RenameUserEventType )
Click to show internal directories.
Click to hide internal directories.