Documentation
¶
Overview ¶
Package service implements the gRPC service handlers for the annotation service.
Index ¶
- Variables
- type AnnotationService
- func (srv *AnnotationService) AddToAnnotationGroup(ctx context.Context, rta *annotation.AnnotationGroupId) (*annotation.TaggedAnnotationGroup, error)
- func (srv *AnnotationService) AutocompleteAnnotation(ctx context.Context, r *annotation.AnnotationAutocompleteParameters) (*annotation.AnnotationSuggestionCollection, error)
- func (srv *AnnotationService) CreateAnnotation(ctx context.Context, rta *annotation.NewTaggedAnnotation) (*annotation.TaggedAnnotation, error)
- func (srv *AnnotationService) CreateAnnotationGroup(ctx context.Context, rta *annotation.AnnotationIdList) (*annotation.TaggedAnnotationGroup, error)
- func (srv *AnnotationService) DeleteAnnotation(ctx context.Context, r *annotation.DeleteAnnotationRequest) (*empty.Empty, error)
- func (srv *AnnotationService) DeleteAnnotationGroup(ctx context.Context, r *annotation.GroupEntryId) (*empty.Empty, error)
- func (srv *AnnotationService) GetAnnotation(ctx context.Context, req *annotation.AnnotationId) (*annotation.TaggedAnnotation, error)
- func (srv *AnnotationService) GetAnnotationGroup(ctx context.Context, rid *annotation.GroupEntryId) (*annotation.TaggedAnnotationGroup, error)
- func (srv *AnnotationService) GetAnnotationTag(ctx context.Context, rta *annotation.TagRequest) (*annotation.AnnotationTag, error)
- func (srv *AnnotationService) GetEntryAnnotation(ctx context.Context, rea *annotation.EntryAnnotationRequest) (*annotation.TaggedAnnotation, error)
- func (srv *AnnotationService) GetGroupResourceName() string
- func (srv *AnnotationService) ListAnnotationGroups(ctx context.Context, rgp *annotation.ListGroupParameters) (*annotation.TaggedAnnotationGroupCollection, error)
- func (srv *AnnotationService) ListAnnotations(ctx context.Context, ral *annotation.ListParameters) (*annotation.TaggedAnnotationCollection, error)
- func (srv *AnnotationService) OboJSONFileUpload(stream annotation.TaggedAnnotationService_OboJSONFileUploadServer) error
- func (srv *AnnotationService) SearchAnnotation(ctx context.Context, r *annotation.AnnotationSearchParameters) (*annotation.AnnotationSearchResultCollection, error)
- func (srv *AnnotationService) UpdateAnnotation(ctx context.Context, rta *annotation.TaggedAnnotationUpdate) (*annotation.TaggedAnnotation, error)
- type FeatureAnnotationService
- func (srv *FeatureAnnotationService) AddTag(ctx context.Context, req *feature.AddTagRequest) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) AddTags(ctx context.Context, req *feature.AddTagsRequest) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) CreateFeatureAnnotation(ctx context.Context, req *feature.NewFeatureAnnotation) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) DeleteFeatureAnnotation(ctx context.Context, req *feature.DeleteFeatureAnnotationRequest) (*emptypb.Empty, error)
- func (srv *FeatureAnnotationService) GetFeatureAnnotation(ctx context.Context, req *feature.FeatureAnnotationId) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) GetFeatureAnnotationByName(ctx context.Context, req *feature.FeatureName) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) ListFeatureAnnotationsByDOI(ctx context.Context, req *feature.DOI) (*feature.FeatureAnnotationCollection, error)
- func (srv *FeatureAnnotationService) ListFeatureAnnotationsByPubmedId(ctx context.Context, req *feature.PubmedId) (*feature.FeatureAnnotationCollection, error)
- func (srv *FeatureAnnotationService) RemoveTags(ctx context.Context, req *feature.RemoveTagsRequest) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) SetTags(ctx context.Context, req *feature.SetTagsRequest) (*feature.FeatureAnnotation, error)
- func (srv *FeatureAnnotationService) UpdateFeatureAnnotation(ctx context.Context, req *feature.FeatureAnnotationUpdate) (*feature.FeatureAnnotation, error)
- type FeatureParams
- type MockMessage
- type Params
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (srv *AnnotationService) AddToAnnotationGroup( ctx context.Context, rta *annotation.AnnotationGroupId, ) (*annotation.TaggedAnnotationGroup, error)
AddToAnnotationGroup appends an annotation to an existing annotation group.
func (*AnnotationService) AutocompleteAnnotation ¶ added in v0.2.0
func (srv *AnnotationService) AutocompleteAnnotation( ctx context.Context, r *annotation.AnnotationAutocompleteParameters, ) (*annotation.AnnotationSuggestionCollection, error)
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 ¶
func (srv *AnnotationService) CreateAnnotation( ctx context.Context, rta *annotation.NewTaggedAnnotation, ) (*annotation.TaggedAnnotation, error)
CreateAnnotation creates a new tagged annotation.
func (*AnnotationService) CreateAnnotationGroup ¶
func (srv *AnnotationService) CreateAnnotationGroup( ctx context.Context, rta *annotation.AnnotationIdList, ) (*annotation.TaggedAnnotationGroup, error)
CreateAnnotationGroup creates a new annotation group from a list of annotation IDs.
func (*AnnotationService) DeleteAnnotation ¶
func (srv *AnnotationService) DeleteAnnotation(ctx context.Context, r *annotation.DeleteAnnotationRequest) (*empty.Empty, error)
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 ¶
func (srv *AnnotationService) GetAnnotation( ctx context.Context, req *annotation.AnnotationId, ) (*annotation.TaggedAnnotation, error)
GetAnnotation retrieves a tagged annotation by its ID.
func (*AnnotationService) GetAnnotationGroup ¶
func (srv *AnnotationService) GetAnnotationGroup( ctx context.Context, rid *annotation.GroupEntryId, ) (*annotation.TaggedAnnotationGroup, error)
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 ¶
func (srv *AnnotationService) GetEntryAnnotation( ctx context.Context, rea *annotation.EntryAnnotationRequest, ) (*annotation.TaggedAnnotation, error)
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 ¶
func (srv *AnnotationService) ListAnnotationGroups( ctx context.Context, rgp *annotation.ListGroupParameters, ) (*annotation.TaggedAnnotationGroupCollection, error)
ListAnnotationGroups returns a paginated collection of tagged annotation groups.
func (*AnnotationService) ListAnnotations ¶
func (srv *AnnotationService) ListAnnotations( ctx context.Context, ral *annotation.ListParameters, ) (*annotation.TaggedAnnotationCollection, error)
ListAnnotations returns a paginated collection of tagged annotations.
func (*AnnotationService) OboJSONFileUpload ¶
func (srv *AnnotationService) OboJSONFileUpload( stream annotation.TaggedAnnotationService_OboJSONFileUploadServer, ) error
OboJSONFileUpload uploads a obojson formatted file to the server.
func (*AnnotationService) SearchAnnotation ¶ added in v0.2.0
func (srv *AnnotationService) SearchAnnotation( ctx context.Context, r *annotation.AnnotationSearchParameters, ) (*annotation.AnnotationSearchResultCollection, error)
SearchAnnotation returns at most 50 ranked strain annotation matches for a search query of at least 2 normalized characters.
func (*AnnotationService) UpdateAnnotation ¶
func (srv *AnnotationService) UpdateAnnotation( ctx context.Context, rta *annotation.TaggedAnnotationUpdate, ) (*annotation.TaggedAnnotation, error)
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 ¶
func (srv *FeatureAnnotationService) AddTag( ctx context.Context, req *feature.AddTagRequest, ) (*feature.FeatureAnnotation, error)
AddTag adds a single tag to the specified feature annotation.
func (*FeatureAnnotationService) AddTags ¶
func (srv *FeatureAnnotationService) AddTags( ctx context.Context, req *feature.AddTagsRequest, ) (*feature.FeatureAnnotation, error)
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 ¶
func (srv *FeatureAnnotationService) GetFeatureAnnotation( ctx context.Context, req *feature.FeatureAnnotationId, ) (*feature.FeatureAnnotation, error)
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 ¶
func (srv *FeatureAnnotationService) RemoveTags( ctx context.Context, req *feature.RemoveTagsRequest, ) (*feature.FeatureAnnotation, error)
RemoveTags removes specified tags from a feature annotation.
func (*FeatureAnnotationService) SetTags ¶
func (srv *FeatureAnnotationService) SetTags( ctx context.Context, req *feature.SetTagsRequest, ) (*feature.FeatureAnnotation, error)
SetTags replaces all tags on the specified feature annotation.
func (*FeatureAnnotationService) UpdateFeatureAnnotation ¶
func (srv *FeatureAnnotationService) UpdateFeatureAnnotation( ctx context.Context, req *feature.FeatureAnnotationUpdate, ) (*feature.FeatureAnnotation, error)
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.