aligreen

package
v0.0.0-...-0cfe510 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioScanner

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

func (*AudioScanner) Async

func (vs *AudioScanner) Async(videos []*ContentScanData) (results []*ContentScanResult, err error)

func (*AudioScanner) AsyncResults

func (vs *AudioScanner) AsyncResults(scans []*ContentScanResult) (results []*ContentScanResult, err error)

func (*AudioScanner) BindClient

func (vs *AudioScanner) BindClient(c *green.Client, bizType string)

func (*AudioScanner) Sync

func (vs *AudioScanner) Sync(images []*ContentScanData) (results []*ContentScanResult, err error)

type AuditStatus

type AuditStatus string
const (
	AuditStatusDoing AuditStatus = "doing"
	AuditStatusPass  AuditStatus = "pass"
	AuditStatusFail  AuditStatus = "fail"
)

type ContentScanData

type ContentScanData struct {
	DataId  string
	Url     string
	Content string
	TaskId  string // 检查结果需要带个值
}

type ContentScanDataType

type ContentScanDataType []*ContentScanData

type ContentScanResult

type ContentScanResult struct {
	DataId      string
	TaskId      string
	AuditStatus AuditStatus // doing审核中 pass审核通过 fail审核未通过
}

type GreenClient

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

func NewBizTypeGreenClient

func NewBizTypeGreenClient(regionId, accessKeyId, accessKeySecret, bizType string) *GreenClient

func NewGreenClient

func NewGreenClient(regionId, accessKeyId, accessKeySecret string) *GreenClient

func (*GreenClient) Async

func (g *GreenClient) Async(s Scanner, data []*ContentScanData) (results []*ContentScanResult, err error)

func (*GreenClient) AsyncResults

func (g *GreenClient) AsyncResults(s Scanner, data []*ContentScanResult) (results []*ContentScanResult, err error)

func (*GreenClient) CanScan

func (g *GreenClient) CanScan(url string) bool

检查是否可以审核

func (*GreenClient) CommonScan

func (g *GreenClient) CommonScan(data []*ContentScanData) (results []*ContentScanResult, err error)

func (*GreenClient) CommonScanIsPass

func (g *GreenClient) CommonScanIsPass(data []*ContentScanData) (isPass bool, err error)

有一个失败就返回失败

func (*GreenClient) CommonScanResults

func (g *GreenClient) CommonScanResults(data []*ContentScanData) (results []*ContentScanResult, err error)

func (*GreenClient) CommonScanResultsAggregation

func (g *GreenClient) CommonScanResultsAggregation(results []*ContentScanResult) (newResults map[string]*ContentScanResult, err error)

聚合dataId 相同的dataId有一个失败则认为失败

func (*GreenClient) GetBizType

func (g *GreenClient) GetBizType() string

func (*GreenClient) Sync

func (g *GreenClient) Sync(s Scanner, data []*ContentScanData) (results []*ContentScanResult, err error)

func (*GreenClient) SyncScan

func (g *GreenClient) SyncScan(data []*ContentScanData) (results []*ContentScanResult, err error)

同步scan 仅支持图片文本

func (*GreenClient) SyncScanIsPass

func (g *GreenClient) SyncScanIsPass(data []*ContentScanData) (isPass bool, err error)

同步scan 仅支持图片文本 有一个失败就返回失败

type ImageScanner

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

func (*ImageScanner) Async

func (ims *ImageScanner) Async(images []*ContentScanData) (results []*ContentScanResult, err error)

func (*ImageScanner) AsyncResults

func (ims *ImageScanner) AsyncResults(scans []*ContentScanResult) (results []*ContentScanResult, err error)

func (*ImageScanner) BindClient

func (ims *ImageScanner) BindClient(c *green.Client, bizType string)

func (*ImageScanner) Sync

func (ims *ImageScanner) Sync(images []*ContentScanData) (results []*ContentScanResult, err error)

type Scanner

type Scanner interface {
	//bind client bizType业务场景,默认default
	BindClient(c *green.Client, bizType string)

	Sync(images []*ContentScanData) (results []*ContentScanResult, err error)

	Async(videos []*ContentScanData) (results []*ContentScanResult, err error)

	AsyncResults(scans []*ContentScanResult) (results []*ContentScanResult, err error)
}

type TextScanner

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

func (*TextScanner) Async

func (vs *TextScanner) Async(videos []*ContentScanData) (results []*ContentScanResult, err error)

func (*TextScanner) AsyncResults

func (vs *TextScanner) AsyncResults(scans []*ContentScanResult) (results []*ContentScanResult, err error)

func (*TextScanner) BindClient

func (ts *TextScanner) BindClient(c *green.Client, bizType string)

func (*TextScanner) Sync

func (ts *TextScanner) Sync(texts []*ContentScanData) (results []*ContentScanResult, err error)

type VideoScanner

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

func (*VideoScanner) Async

func (vs *VideoScanner) Async(videos []*ContentScanData) (results []*ContentScanResult, err error)

func (*VideoScanner) AsyncResults

func (vs *VideoScanner) AsyncResults(scans []*ContentScanResult) (results []*ContentScanResult, err error)

func (*VideoScanner) BindClient

func (vs *VideoScanner) BindClient(c *green.Client, bizType string)

func (*VideoScanner) Sync

func (vs *VideoScanner) Sync(images []*ContentScanData) (results []*ContentScanResult, err error)

Jump to

Keyboard shortcuts

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