wssmoderator

package
v0.0.0-...-4020383 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//ContentModeratorSubscriptionKey Azure ContentModerator Subscription env key
	ContentModeratorSubscriptionKey = "WSS_CONTENTMODERATOR_SUBSCRIPTION_KEY"
	//ContentModeratorEndpointKey Azure ContentModerator Endpoint env key
	ContentModeratorEndpointKey = "WSS_CONTENTMODERATOR_ENDPOINT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	ContentModeratorSubscription string
	ServiceEnpoint               string
}

Configuration structure for the ContentModerator service configuration

func BuildConfigurationFromEnvs

func BuildConfigurationFromEnvs() (*Configuration, error)

BuildConfigurationFromEnvs builds the configuration from env variables

func (*Configuration) IsValid

func (c *Configuration) IsValid() bool

IsValid Checks if the configuration is valid

type ContentModeratorPhotoResult

type ContentModeratorPhotoResult struct {
	Adult bool
	Racy  bool
}

ContentModeratorPhotoResult result of the ContentModeratorAPI for the evaluation of a photo

type ContentModeratorServiceClient

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

ContentModeratorServiceClient client for the Azure ContentModerator Service

func NewContentModeratorServiceClient

func NewContentModeratorServiceClient(conf *Configuration) *ContentModeratorServiceClient

NewContentModeratorServiceClient ContentModeratorServiceClient constructor

func (*ContentModeratorServiceClient) InvokeContentModeratorPhoto

func (s *ContentModeratorServiceClient) InvokeContentModeratorPhoto(ctx context.Context, photo io.ReadCloser) (*ContentModeratorPhotoResult, error)

InvokeContentModeratorPhoto invokes the ContentModerator APIs with the provided photo

func (*ContentModeratorServiceClient) InvokeContentModeratorText

func (s *ContentModeratorServiceClient) InvokeContentModeratorText(ctx context.Context, message string) (*ContentModeratorTextResult, error)

InvokeContentModeratorText invokes the ContentModerator APIs with the provided message

type ContentModeratorTextResult

type ContentModeratorTextResult struct {
	BadWords []string
}

ContentModeratorTextResult result of the ContentModeratorAPI for the evaluation of a message

Jump to

Keyboard shortcuts

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