moderator

package
v0.5.18 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 31 Imported by: 0

Documentation

Overview

Warpnet - Decentralized Social Network Copyright (C) 2025 Vadim Filin, https://github.com/Warp-net, <github.com.mecdy@passmail.net>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

WarpNet is provided “as is” without warranty of any kind, either expressed or implied. Use at your own risk. The maintainers shall not be liable for any damages or data loss resulting from the use or misuse of this software.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Result event.ModerationResultEvent
	// contains filtered or unexported fields
}

type DiscoveryHandler

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

type DistributedHashTableCloser

type DistributedHashTableCloser interface {
	ClosestPeers() ([]warpnet.WarpPeerID, error)
	Close()
}

type DistributedStorer

type DistributedStorer interface {
	GetStream(ctx context.Context, id string) (io.ReadCloser, error)
	PutStream(ctx context.Context, reader io.ReadCloser) (id string, _ error)
	Close() error
}

type Moderator

type Moderator interface {
	Moderate(content string) (bool, string, error)
	Close()
}

type ModeratorNode

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

func NewModeratorNode

func NewModeratorNode(
	ctx context.Context,
	privKey ed25519.PrivateKey,
	psk security.PSK,
	selfHashHex string,
) (_ *ModeratorNode, err error)

func (*ModeratorNode) GenericStream

func (mn *ModeratorNode) GenericStream(nodeIdStr string, path stream.WarpRoute, data any) (_ []byte, err error)

func (*ModeratorNode) NodeInfo

func (mn *ModeratorNode) NodeInfo() warpnet.NodeInfo

func (*ModeratorNode) Start

func (mn *ModeratorNode) Start() (err error)

func (*ModeratorNode) Stop

func (mn *ModeratorNode) Stop()

type ProviderCloser

type ProviderCloser interface {
	io.Closer
}

Jump to

Keyboard shortcuts

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