services

package
v0.0.0-...-aec1015 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AbuseClientHostFlag = "abuse-host"
	AbuseClientPortFlag = "abuse-port"
)
View Source
const (
	AbuseUseFlag = "use-abuse"
)
View Source
const (
	StoplistPathFlag = "stoplist-path"
)

Variables

View Source
var (
	ErrAbuse = errors.New("store: torrent abused")
)
View Source
var (
	ErrNotFound = errors.New("store: torrent not found")
)

Functions

func RegisterAbuseClientFlags

func RegisterAbuseClientFlags(f []cli.Flag) []cli.Flag

func RegisterAbuseFlags

func RegisterAbuseFlags(f []cli.Flag) []cli.Flag

func RegisterGRPCFlags

func RegisterGRPCFlags(f []cli.Flag) []cli.Flag

func RegisterStoplistFlags

func RegisterStoplistFlags(f []cli.Flag) []cli.Flag

Types

type Abuse

type Abuse struct {
	lazymap.LazyMap
	// contains filtered or unexported fields
}

func NewAbuse

func NewAbuse(c *cli.Context, cl *AbuseClient) *Abuse

func (*Abuse) Get

func (s *Abuse) Get(h string) error

type AbuseClient

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

func NewAbuseClient

func NewAbuseClient(c *cli.Context) *AbuseClient

func (*AbuseClient) Close

func (s *AbuseClient) Close()

func (*AbuseClient) Get

func (s *AbuseClient) Get() (as.AbuseStoreClient, error)

type GRPCServer

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

func NewGRPCServer

func NewGRPCServer(c *cli.Context, s *Server) *GRPCServer

func (*GRPCServer) Close

func (s *GRPCServer) Close()

func (*GRPCServer) Serve

func (s *GRPCServer) Serve() error

type Server

type Server struct {
	pb.UnimplementedTorrentStoreServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(s *Store, a *Abuse, sl *Stoplist) *Server

func (*Server) Pull

func (s *Server) Pull(ctx context.Context, in *pb.PullRequest) (*pb.PullReply, error)

func (*Server) Push

func (s *Server) Push(ctx context.Context, in *pb.PushRequest) (*pb.PushReply, error)

func (*Server) Touch

func (s *Server) Touch(ctx context.Context, in *pb.TouchRequest) (*pb.TouchReply, error)

type Stoplist

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

func NewStoplist

func NewStoplist(c *cli.Context) (*Stoplist, error)

func (*Stoplist) Check

func (s *Stoplist) Check(b []byte) (*sl.CheckResult, error)

type Store

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

func NewStore

func NewStore(providers []StoreProvider) *Store

func (*Store) Pull

func (s *Store) Pull(h string) (torrent []byte, err error)

func (*Store) Push

func (s *Store) Push(h string, torrent []byte) (err error)

func (*Store) Touch

func (s *Store) Touch(h string) (err error)

type StoreProvider

type StoreProvider interface {
	Push(h string, torrent []byte) (err error)
	Pull(h string) (torrent []byte, err error)
	Touch(h string) (err error)
	Name() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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