services

package
v0.0.0-...-23cc558 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("store: abuse not found")
)

Functions

func NewBadger

func NewBadger(c *cli.Context) *badger.DB

func RegisterGRPCFlags

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

func RegisterMailerFlags

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

func RegisterSMTPFlags

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

func RegisterStoreFlags

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

Types

type GRPC

type GRPC struct {
	pb.UnimplementedAbuseStoreServer
	// contains filtered or unexported fields
}

func NewGRPC

func NewGRPC(c *cli.Context, s *Store, mr *Mailer) *GRPC

func (*GRPC) Check

func (s *GRPC) Check(ctx context.Context, in *pb.CheckRequest) (*pb.CheckReply, error)

func (*GRPC) Close

func (s *GRPC) Close()

func (*GRPC) Push

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

func (*GRPC) Serve

func (s *GRPC) Serve() error

type Mailer

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

func NewMailer

func NewMailer(c *cli.Context, smtp *SMTP) *Mailer

func (*Mailer) SendSupportEmail

func (s *Mailer) SendSupportEmail(a *m.Abuse) error

func (*Mailer) SendUserEmail

func (s *Mailer) SendUserEmail(a *m.Abuse) error

type SMTP

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

func NewSMTP

func NewSMTP(c *cli.Context) *SMTP

func (*SMTP) Send

func (s *SMTP) Send(from string, to string, subj string, body string) error

type Store

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

func NewStore

func NewStore(c *cli.Context, b *badger.DB, p *cs.PG) *Store

func (*Store) Check

func (s *Store) Check(i string) error

func (*Store) Push

func (s *Store) Push(a *m.Abuse) error

func (*Store) Serve

func (s *Store) Serve() error

func (*Store) Sync

func (s *Store) Sync() error

type View

type View struct {
	Abuse   *m.Abuse
	Support string
}

Jump to

Keyboard shortcuts

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