Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: BSD-2-Clause Imports: 46 Imported by: 0

Documentation

Overview

Package service implements the gRPC service handlers for the annotation service.

Index

Constants

This section is empty.

Variables

View Source
var LIMIT int64 = 10

LIMIT is the default number of results returned by list operations.

Functions

This section is empty.

Types

type AnnotationService

type AnnotationService struct {
	*aphgrpc.Service

	annotation.UnimplementedTaggedAnnotationServiceServer
	// contains filtered or unexported fields
}

AnnotationService is the container for managing annotation service definition.

func NewAnnotationService

func NewAnnotationService(srvP *Params) (*AnnotationService, error)

NewAnnotationService is the constructor for creating a new instance of AnnotationService. The whole construction is one Either pipeline forced once, at the boundary.

func (*AnnotationService) AddToAnnotationGroup

AddToAnnotationGroup appends an annotation to an existing annotation group.

func (*AnnotationService) AutocompleteAnnotation added in v0.2.0

AutocompleteAnnotation returns annotation suggestions for a partial strain synonym or genotype value. Guards are pure Either, the repository call is the only effect, and the whole program is forced once at the boundary.

func (*AnnotationService) CreateAnnotation

CreateAnnotation creates a new tagged annotation.

func (*AnnotationService) CreateAnnotationGroup

CreateAnnotationGroup creates a new annotation group from a list of annotation IDs.

func (*AnnotationService) DeleteAnnotation

DeleteAnnotation removes a tagged annotation by its ID.

func (*AnnotationService) DeleteAnnotationGroup

func (srv *AnnotationService) DeleteAnnotationGroup(ctx context.Context, r *annotation.GroupEntryId) (*empty.Empty, error)

DeleteAnnotationGroup removes an annotation group identified by its group ID.

func (*AnnotationService) GetAnnotation

GetAnnotation retrieves a tagged annotation by its ID.

func (*AnnotationService) GetAnnotationGroup

GetAnnotationGroup retrieves a tagged annotation group by its group ID.

func (*AnnotationService) GetAnnotationTag

func (srv *AnnotationService) GetAnnotationTag(
	ctx context.Context, rta *annotation.TagRequest,
) (*annotation.AnnotationTag, error)

GetAnnotationTag retrieves an annotation tag by name and ontology.

func (*AnnotationService) GetEntryAnnotation

GetEntryAnnotation retrieves a tagged annotation by entry annotation request parameters.

func (*AnnotationService) GetGroupResourceName

func (srv *AnnotationService) GetGroupResourceName() string

GetGroupResourceName returns the resource name used for annotation groups.

func (*AnnotationService) ListAnnotationGroups

ListAnnotationGroups returns a paginated collection of tagged annotation groups.

func (*AnnotationService) ListAnnotations

ListAnnotations returns a paginated collection of tagged annotations.

func (*AnnotationService) OboJSONFileUpload

OboJSONFileUpload uploads a obojson formatted file to the server.

func (*AnnotationService) SearchAnnotation added in v0.2.0

SearchAnnotation returns at most 50 ranked strain annotation matches for a search query of at least 2 normalized characters.

func (*AnnotationService) UpdateAnnotation

UpdateAnnotation updates an existing tagged annotation.

type FeatureAnnotationService

type FeatureAnnotationService struct {
	*aphgrpc.Service

	feature.UnimplementedFeatureAnnotationServiceServer
	// contains filtered or unexported fields
}

FeatureAnnotationService implements the gRPC FeatureAnnotationService server.

func NewFeatureAnnotationService

func NewFeatureAnnotationService(
	params *FeatureParams,
) (*FeatureAnnotationService, error)

NewFeatureAnnotationService creates a new FeatureAnnotationService from the given parameters.

func (*FeatureAnnotationService) AddTag

AddTag adds a single tag to the specified feature annotation.

func (*FeatureAnnotationService) AddTags

AddTags adds multiple tags to the specified feature annotation.

func (*FeatureAnnotationService) CreateFeatureAnnotation

func (srv *FeatureAnnotationService) CreateFeatureAnnotation(
	ctx context.Context,
	req *feature.NewFeatureAnnotation,
) (*feature.FeatureAnnotation, error)

CreateFeatureAnnotation creates a new feature annotation from the provided request.

func (*FeatureAnnotationService) DeleteFeatureAnnotation

func (srv *FeatureAnnotationService) DeleteFeatureAnnotation(
	ctx context.Context,
	req *feature.DeleteFeatureAnnotationRequest,
) (*emptypb.Empty, error)

DeleteFeatureAnnotation removes a feature annotation by its ID.

func (*FeatureAnnotationService) GetFeatureAnnotation

GetFeatureAnnotation retrieves a feature annotation by its ID.

func (*FeatureAnnotationService) GetFeatureAnnotationByName

func (srv *FeatureAnnotationService) GetFeatureAnnotationByName(
	ctx context.Context,
	req *feature.FeatureName,
) (*feature.FeatureAnnotation, error)

GetFeatureAnnotationByName retrieves a feature annotation by its name.

func (*FeatureAnnotationService) ListFeatureAnnotationsByDOI

func (srv *FeatureAnnotationService) ListFeatureAnnotationsByDOI(
	ctx context.Context,
	req *feature.DOI,
) (*feature.FeatureAnnotationCollection, error)

ListFeatureAnnotationsByDOI lists all feature annotations associated with a DOI.

func (*FeatureAnnotationService) ListFeatureAnnotationsByPubmedId

func (srv *FeatureAnnotationService) ListFeatureAnnotationsByPubmedId(
	ctx context.Context,
	req *feature.PubmedId,
) (*feature.FeatureAnnotationCollection, error)

ListFeatureAnnotationsByPubmedId lists all feature annotations associated with a PubMed ID.

func (*FeatureAnnotationService) RemoveTags

RemoveTags removes specified tags from a feature annotation.

func (*FeatureAnnotationService) SetTags

SetTags replaces all tags on the specified feature annotation.

func (*FeatureAnnotationService) UpdateFeatureAnnotation

UpdateFeatureAnnotation updates an existing feature annotation.

type FeatureParams

type FeatureParams struct {
	Repository repository.FeatureAnnotationRepository `validate:"required"`
	Publisher  message.FeatureAnnotationPublisher     `validate:"required"`
	Options    []aphgrpc.Option
}

FeatureParams holds the required parameters for creating a FeatureAnnotationService.

type MockMessage

type MockMessage struct{}

MockMessage is a no-op message publisher used in tests.

func (*MockMessage) Close

func (msn *MockMessage) Close() error

Close implements the Publisher interface as a no-op.

func (*MockMessage) Publish

func (msn *MockMessage) Publish(
	_ string,
	_ *feature.FeatureAnnotation,
) error

Publish implements the Publisher interface as a no-op.

type Params

type Params struct {
	Repository repository.TaggedAnnotationRepository `validate:"required"`
	Publisher  message.Publisher                     `validate:"required"`
	Options    []aphgrpc.Option                      `validate:"required"`
	Group      string                                `validate:"required"`
}

Params are the attributes that are required for creating a new AnnotationService.

Jump to

Keyboard shortcuts

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