spam

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 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

View Source
var File_proto_spam_proto protoreflect.FileDescriptor

Functions

func NewSpamEndpoints

func NewSpamEndpoints() []*api.Endpoint

func RegisterSpamHandler

func RegisterSpamHandler(s server.Server, hdlr SpamHandler, opts ...server.HandlerOption) error

Types

type ClassifyRequest

type ClassifyRequest struct {

	// The raw body of the email including headers etc per RFC 822. Alternatively, use the other parameters to correctly format the message
	EmailBody string `protobuf:"bytes,1,opt,name=email_body,json=emailBody,proto3" json:"email_body,omitempty"`
	// The email address it is being sent to
	To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	// The email address it has been sent from
	From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"`
	// The subject of the email
	Subject string `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
	// the plain text version of the email body
	TextBody string `protobuf:"bytes,5,opt,name=text_body,json=textBody,proto3" json:"text_body,omitempty"`
	// the HTML version of the email body
	HtmlBody string `protobuf:"bytes,6,opt,name=html_body,json=htmlBody,proto3" json:"html_body,omitempty"`
	// contains filtered or unexported fields
}

Check whether an email is likely to be spam based on its attributes

func (*ClassifyRequest) Descriptor deprecated

func (*ClassifyRequest) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyRequest.ProtoReflect.Descriptor instead.

func (*ClassifyRequest) GetEmailBody

func (x *ClassifyRequest) GetEmailBody() string

func (*ClassifyRequest) GetFrom

func (x *ClassifyRequest) GetFrom() string

func (*ClassifyRequest) GetHtmlBody

func (x *ClassifyRequest) GetHtmlBody() string

func (*ClassifyRequest) GetSubject

func (x *ClassifyRequest) GetSubject() string

func (*ClassifyRequest) GetTextBody

func (x *ClassifyRequest) GetTextBody() string

func (*ClassifyRequest) GetTo

func (x *ClassifyRequest) GetTo() string

func (*ClassifyRequest) ProtoMessage

func (*ClassifyRequest) ProtoMessage()

func (*ClassifyRequest) ProtoReflect

func (x *ClassifyRequest) ProtoReflect() protoreflect.Message

func (*ClassifyRequest) Reset

func (x *ClassifyRequest) Reset()

func (*ClassifyRequest) String

func (x *ClassifyRequest) String() string

type ClassifyResponse

type ClassifyResponse struct {

	// Is it spam? Returns true if its score is > 5
	IsSpam bool `protobuf:"varint,1,opt,name=is_spam,json=isSpam,proto3" json:"is_spam,omitempty"`
	// The score evaluated for this email. A higher number means it is more likely to be spam
	Score float64 `protobuf:"fixed64,2,opt,name=score,proto3" json:"score,omitempty"`
	// The rules that have contributed to this score
	Details []string `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*ClassifyResponse) Descriptor deprecated

func (*ClassifyResponse) Descriptor() ([]byte, []int)

Deprecated: Use ClassifyResponse.ProtoReflect.Descriptor instead.

func (*ClassifyResponse) GetDetails

func (x *ClassifyResponse) GetDetails() []string

func (*ClassifyResponse) GetIsSpam

func (x *ClassifyResponse) GetIsSpam() bool

func (*ClassifyResponse) GetScore

func (x *ClassifyResponse) GetScore() float64

func (*ClassifyResponse) ProtoMessage

func (*ClassifyResponse) ProtoMessage()

func (*ClassifyResponse) ProtoReflect

func (x *ClassifyResponse) ProtoReflect() protoreflect.Message

func (*ClassifyResponse) Reset

func (x *ClassifyResponse) Reset()

func (*ClassifyResponse) String

func (x *ClassifyResponse) String() string

type SpamHandler

type SpamHandler interface {
	Classify(context.Context, *ClassifyRequest, *ClassifyResponse) error
}

type SpamService

type SpamService interface {
	Classify(ctx context.Context, in *ClassifyRequest, opts ...client.CallOption) (*ClassifyResponse, error)
}

func NewSpamService

func NewSpamService(name string, c client.Client) SpamService

Jump to

Keyboard shortcuts

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