comprehend

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is the cloudmock implementation of the AWS comprehend service.

func New

func New(accountID, region string) *Service

New returns a new comprehend Service.

func (*Service) Actions

func (s *Service) Actions() []service.Action

Actions returns all supported API actions.

func (*Service) HandleRequest

func (s *Service) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes a request to the appropriate handler.

func (*Service) HealthCheck

func (s *Service) HealthCheck() error

HealthCheck always returns nil.

func (*Service) Name

func (s *Service) Name() string

Name returns the AWS service name used for request routing.

type Store

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

Store is the in-memory data store for comprehend resources.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty Store.

func (*Store) CreateDataset

CreateDataset persists a new dataset attached to a flywheel.

func (*Store) CreateDocumentClassifier

func (s *Store) CreateDocumentClassifier(c *StoredDocumentClassifier) (*StoredDocumentClassifier, *service.AWSError)

CreateDocumentClassifier persists a new classifier.

func (*Store) CreateEndpoint

func (s *Store) CreateEndpoint(e *StoredEndpoint) (*StoredEndpoint, *service.AWSError)

CreateEndpoint persists a new endpoint.

func (*Store) CreateEntityRecognizer

func (s *Store) CreateEntityRecognizer(r *StoredEntityRecognizer) (*StoredEntityRecognizer, *service.AWSError)

CreateEntityRecognizer persists a new recognizer.

func (*Store) CreateFlywheel

func (s *Store) CreateFlywheel(f *StoredFlywheel) (*StoredFlywheel, *service.AWSError)

CreateFlywheel persists a new flywheel.

func (*Store) CreateJob

func (s *Store) CreateJob(kind string, j *StoredJob) *StoredJob

CreateJob creates a new job of the given kind with COMPLETED status.

func (*Store) DeleteDocumentClassifier

func (s *Store) DeleteDocumentClassifier(arn string) *service.AWSError

DeleteDocumentClassifier removes the classifier with the given ARN.

func (*Store) DeleteEndpoint

func (s *Store) DeleteEndpoint(arn string) *service.AWSError

DeleteEndpoint removes the endpoint with the given ARN.

func (*Store) DeleteEntityRecognizer

func (s *Store) DeleteEntityRecognizer(arn string) *service.AWSError

DeleteEntityRecognizer removes the recognizer with the given ARN.

func (*Store) DeleteFlywheel

func (s *Store) DeleteFlywheel(arn string) *service.AWSError

DeleteFlywheel removes the flywheel with the given ARN.

func (*Store) DeleteResourcePolicy

func (s *Store) DeleteResourcePolicy(arn string) *service.AWSError

DeleteResourcePolicy removes the resource policy for the given ARN.

func (*Store) GetDataset

func (s *Store) GetDataset(arn string) (*StoredFlywheelDataset, *service.AWSError)

GetDataset returns a dataset by ARN.

func (*Store) GetDocumentClassifier

func (s *Store) GetDocumentClassifier(arn string) (*StoredDocumentClassifier, *service.AWSError)

GetDocumentClassifier returns the classifier with the given ARN.

func (*Store) GetEndpoint

func (s *Store) GetEndpoint(arn string) (*StoredEndpoint, *service.AWSError)

GetEndpoint returns the endpoint with the given ARN.

func (*Store) GetEntityRecognizer

func (s *Store) GetEntityRecognizer(arn string) (*StoredEntityRecognizer, *service.AWSError)

GetEntityRecognizer returns the recognizer with the given ARN.

func (*Store) GetFlywheel

func (s *Store) GetFlywheel(arn string) (*StoredFlywheel, *service.AWSError)

GetFlywheel returns the flywheel with the given ARN.

func (*Store) GetFlywheelIteration

func (s *Store) GetFlywheelIteration(arn, iterationID string) (*StoredFlywheelIteration, *service.AWSError)

GetFlywheelIteration returns an iteration by flywheel ARN and iteration ID.

func (*Store) GetJob

func (s *Store) GetJob(kind, id string) (*StoredJob, *service.AWSError)

GetJob returns a job by kind and ID.

func (*Store) GetResourcePolicy

func (s *Store) GetResourcePolicy(arn string) (*StoredResourcePolicy, *service.AWSError)

GetResourcePolicy returns the resource policy for the given ARN.

func (*Store) ListDatasets

func (s *Store) ListDatasets(flywheelArn string) []*StoredFlywheelDataset

ListDatasets returns datasets, optionally filtered by flywheel ARN.

func (*Store) ListDocumentClassifiers

func (s *Store) ListDocumentClassifiers() []*StoredDocumentClassifier

ListDocumentClassifiers returns all classifiers.

func (*Store) ListEndpoints

func (s *Store) ListEndpoints() []*StoredEndpoint

ListEndpoints returns all endpoints.

func (*Store) ListEntityRecognizers

func (s *Store) ListEntityRecognizers() []*StoredEntityRecognizer

ListEntityRecognizers returns all recognizers.

func (*Store) ListFlywheelIterations

func (s *Store) ListFlywheelIterations(arn string) ([]*StoredFlywheelIteration, *service.AWSError)

ListFlywheelIterations returns all iterations for the given flywheel.

func (*Store) ListFlywheels

func (s *Store) ListFlywheels() []*StoredFlywheel

ListFlywheels returns all flywheels.

func (*Store) ListJobs

func (s *Store) ListJobs(kind string) []*StoredJob

ListJobs returns all jobs of the given kind.

func (*Store) ListTags

func (s *Store) ListTags(arn string) map[string]string

ListTags returns the tags for the given ARN.

func (*Store) PutResourcePolicy

func (s *Store) PutResourcePolicy(arn, policyText, expectedRevisionID string) (*StoredResourcePolicy, *service.AWSError)

PutResourcePolicy creates or updates a resource policy.

func (*Store) Reset

func (s *Store) Reset()

Reset clears all in-memory state.

func (*Store) StartFlywheelIteration

func (s *Store) StartFlywheelIteration(arn string) (*StoredFlywheelIteration, *service.AWSError)

StartFlywheelIteration starts a new iteration for the given flywheel.

func (*Store) StopJob

func (s *Store) StopJob(kind, id string) (*StoredJob, *service.AWSError)

StopJob transitions a job to STOP_REQUESTED.

func (*Store) StopTrainingDocumentClassifier

func (s *Store) StopTrainingDocumentClassifier(arn string) *service.AWSError

StopTrainingDocumentClassifier transitions a classifier to STOP_REQUESTED.

func (*Store) StopTrainingEntityRecognizer

func (s *Store) StopTrainingEntityRecognizer(arn string) *service.AWSError

StopTrainingEntityRecognizer transitions a recognizer to STOP_REQUESTED.

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags map[string]string)

TagResource adds tags to the given ARN.

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, keys []string)

UntagResource removes the given keys from the ARN's tags.

func (*Store) UpdateEndpoint

func (s *Store) UpdateEndpoint(arn string, desiredModelArn, desiredDataAccessRoleArn, flywheelArn string, desiredInferenceUnits int) (*StoredEndpoint, *service.AWSError)

UpdateEndpoint updates desired fields on an endpoint.

func (*Store) UpdateFlywheel

func (s *Store) UpdateFlywheel(arn, activeModelArn, dataAccessRoleArn string, dataSecurityConfig map[string]any) (*StoredFlywheel, *service.AWSError)

UpdateFlywheel updates fields on a flywheel.

type StoredDocumentClassifier

type StoredDocumentClassifier struct {
	Arn                string
	Name               string
	VersionName        string
	Status             string
	Message            string
	SubmitTime         time.Time
	EndTime            time.Time
	TrainingStartTime  time.Time
	TrainingEndTime    time.Time
	InputDataConfig    map[string]any
	OutputDataConfig   map[string]any
	ClassifierMetadata map[string]any
	DataAccessRoleArn  string
	LanguageCode       string
	VolumeKmsKeyId     string
	ModelKmsKeyId      string
	VpcConfig          map[string]any
	Mode               string
	SourceModelArn     string
	FlywheelArn        string
	Tags               map[string]string
}

StoredDocumentClassifier is a persisted document classifier.

type StoredEndpoint

type StoredEndpoint struct {
	Arn                      string
	Name                     string
	Status                   string
	Message                  string
	ModelArn                 string
	DesiredModelArn          string
	DesiredInferenceUnits    int
	CurrentInferenceUnits    int
	CreationTime             time.Time
	LastModifiedTime         time.Time
	DataAccessRoleArn        string
	DesiredDataAccessRoleArn string
	FlywheelArn              string
	Tags                     map[string]string
}

StoredEndpoint is a persisted real-time endpoint.

type StoredEntityRecognizer

type StoredEntityRecognizer struct {
	Arn                string
	Name               string
	VersionName        string
	Status             string
	Message            string
	SubmitTime         time.Time
	EndTime            time.Time
	TrainingStartTime  time.Time
	TrainingEndTime    time.Time
	InputDataConfig    map[string]any
	RecognizerMetadata map[string]any
	DataAccessRoleArn  string
	LanguageCode       string
	VolumeKmsKeyId     string
	ModelKmsKeyId      string
	VpcConfig          map[string]any
	SourceModelArn     string
	FlywheelArn        string
	Tags               map[string]string
}

StoredEntityRecognizer is a persisted entity recognizer.

type StoredFlywheel

type StoredFlywheel struct {
	Arn                     string
	Name                    string
	ActiveModelArn          string
	DataAccessRoleArn       string
	TaskConfig              map[string]any
	DataLakeS3Uri           string
	DataSecurityConfig      map[string]any
	Status                  string
	ModelType               string
	Message                 string
	CreationTime            time.Time
	LastModifiedTime        time.Time
	LatestFlywheelIteration string
	Iterations              map[string]*StoredFlywheelIteration
	Datasets                map[string]*StoredFlywheelDataset
	Tags                    map[string]string
}

StoredFlywheel is a persisted flywheel.

type StoredFlywheelDataset

type StoredFlywheelDataset struct {
	Arn               string
	FlywheelArn       string
	Name              string
	Type              string
	Status            string
	Message           string
	NumberOfDocuments int64
	CreationTime      time.Time
	EndTime           time.Time
	Description       string
	InputDataConfig   map[string]any
}

StoredFlywheelDataset is a dataset attached to a flywheel.

type StoredFlywheelIteration

type StoredFlywheelIteration struct {
	WorkflowArn                string
	FlywheelArn                string
	IterationId                string
	CreationTime               time.Time
	EndTime                    time.Time
	Status                     string
	Message                    string
	EvaluatedModelArn          string
	EvaluatedModelMetrics      map[string]any
	TrainedModelArn            string
	TrainedModelMetrics        map[string]any
	EvaluationManifestS3Prefix string
}

StoredFlywheelIteration is a single iteration of a flywheel.

type StoredJob

type StoredJob struct {
	JobId                 string
	JobArn                string
	JobName               string
	JobStatus             string
	Message               string
	SubmitTime            time.Time
	EndTime               time.Time
	InputDataConfig       map[string]any
	OutputDataConfig      map[string]any
	DataAccessRoleArn     string
	LanguageCode          string
	VolumeKmsKeyId        string
	VpcConfig             map[string]any
	ClientRequestToken    string
	FlywheelArn           string
	ModelKmsKeyId         string
	NumberOfTopics        int
	TargetEventTypes      []string
	Mode                  string
	RedactionConfig       map[string]any
	ModelArn              string
	EntityRecognizerArn   string
	DocumentClassifierArn string
}

StoredJob is a persisted async detection/classification/topic job.

type StoredResourcePolicy

type StoredResourcePolicy struct {
	ResourceArn      string
	PolicyText       string
	CreationTime     time.Time
	LastModifiedTime time.Time
	PolicyRevisionId string
}

StoredResourcePolicy is a per-ARN resource policy.

Jump to

Keyboard shortcuts

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