Documentation ¶
Index ¶
- type APIServer
- func (server *APIServer) CreateAssetProbe(ctx context.Context, req *compassv1beta1.CreateAssetProbeRequest) (*compassv1beta1.CreateAssetProbeResponse, error)
- func (server *APIServer) CreateComment(ctx context.Context, req *compassv1beta1.CreateCommentRequest) (*compassv1beta1.CreateCommentResponse, error)
- func (server *APIServer) CreateDiscussion(ctx context.Context, req *compassv1beta1.CreateDiscussionRequest) (*compassv1beta1.CreateDiscussionResponse, error)
- func (server *APIServer) CreateTagAsset(ctx context.Context, req *compassv1beta1.CreateTagAssetRequest) (*compassv1beta1.CreateTagAssetResponse, error)
- func (server *APIServer) CreateTagTemplate(ctx context.Context, req *compassv1beta1.CreateTagTemplateRequest) (*compassv1beta1.CreateTagTemplateResponse, error)
- func (server *APIServer) DeleteAsset(ctx context.Context, req *compassv1beta1.DeleteAssetRequest) (*compassv1beta1.DeleteAssetResponse, error)
- func (server *APIServer) DeleteAssets(ctx context.Context, req *compassv1beta1.DeleteAssetsRequest) (*compassv1beta1.DeleteAssetsResponse, error)
- func (server *APIServer) DeleteComment(ctx context.Context, req *compassv1beta1.DeleteCommentRequest) (*compassv1beta1.DeleteCommentResponse, error)
- func (server *APIServer) DeleteTagAsset(ctx context.Context, req *compassv1beta1.DeleteTagAssetRequest) (*compassv1beta1.DeleteTagAssetResponse, error)
- func (server *APIServer) DeleteTagTemplate(ctx context.Context, req *compassv1beta1.DeleteTagTemplateRequest) (*compassv1beta1.DeleteTagTemplateResponse, error)
- func (server *APIServer) GetAllAssets(ctx context.Context, req *compassv1beta1.GetAllAssetsRequest) (*compassv1beta1.GetAllAssetsResponse, error)
- func (server *APIServer) GetAllComments(ctx context.Context, req *compassv1beta1.GetAllCommentsRequest) (*compassv1beta1.GetAllCommentsResponse, error)
- func (server *APIServer) GetAllDiscussions(ctx context.Context, req *compassv1beta1.GetAllDiscussionsRequest) (*compassv1beta1.GetAllDiscussionsResponse, error)
- func (server *APIServer) GetAllTagTemplates(ctx context.Context, req *compassv1beta1.GetAllTagTemplatesRequest) (*compassv1beta1.GetAllTagTemplatesResponse, error)
- func (server *APIServer) GetAllTagsByAsset(ctx context.Context, req *compassv1beta1.GetAllTagsByAssetRequest) (*compassv1beta1.GetAllTagsByAssetResponse, error)
- func (server *APIServer) GetAllTypes(ctx context.Context, req *compassv1beta1.GetAllTypesRequest) (*compassv1beta1.GetAllTypesResponse, error)
- func (server *APIServer) GetAssetByID(ctx context.Context, req *compassv1beta1.GetAssetByIDRequest) (*compassv1beta1.GetAssetByIDResponse, error)
- func (server *APIServer) GetAssetByVersion(ctx context.Context, req *compassv1beta1.GetAssetByVersionRequest) (*compassv1beta1.GetAssetByVersionResponse, error)
- func (server *APIServer) GetAssetStargazers(ctx context.Context, req *compassv1beta1.GetAssetStargazersRequest) (*compassv1beta1.GetAssetStargazersResponse, error)
- func (server *APIServer) GetAssetVersionHistory(ctx context.Context, req *compassv1beta1.GetAssetVersionHistoryRequest) (*compassv1beta1.GetAssetVersionHistoryResponse, error)
- func (server *APIServer) GetComment(ctx context.Context, req *compassv1beta1.GetCommentRequest) (*compassv1beta1.GetCommentResponse, error)
- func (server *APIServer) GetDiscussion(ctx context.Context, req *compassv1beta1.GetDiscussionRequest) (*compassv1beta1.GetDiscussionResponse, error)
- func (server *APIServer) GetGraph(ctx context.Context, req *compassv1beta1.GetGraphRequest) (*compassv1beta1.GetGraphResponse, error)
- func (server *APIServer) GetMyDiscussions(ctx context.Context, req *compassv1beta1.GetMyDiscussionsRequest) (*compassv1beta1.GetMyDiscussionsResponse, error)
- func (server *APIServer) GetMyStarredAsset(ctx context.Context, req *compassv1beta1.GetMyStarredAssetRequest) (*compassv1beta1.GetMyStarredAssetResponse, error)
- func (server *APIServer) GetMyStarredAssets(ctx context.Context, req *compassv1beta1.GetMyStarredAssetsRequest) (*compassv1beta1.GetMyStarredAssetsResponse, error)
- func (server *APIServer) GetTagByAssetAndTemplate(ctx context.Context, req *compassv1beta1.GetTagByAssetAndTemplateRequest) (*compassv1beta1.GetTagByAssetAndTemplateResponse, error)
- func (server *APIServer) GetTagTemplate(ctx context.Context, req *compassv1beta1.GetTagTemplateRequest) (*compassv1beta1.GetTagTemplateResponse, error)
- func (server *APIServer) GetUserStarredAssets(ctx context.Context, req *compassv1beta1.GetUserStarredAssetsRequest) (*compassv1beta1.GetUserStarredAssetsResponse, error)
- func (server *APIServer) GroupAssets(ctx context.Context, req *compassv1beta1.GroupAssetsRequest) (*compassv1beta1.GroupAssetsResponse, error)
- func (server *APIServer) PatchDiscussion(ctx context.Context, req *compassv1beta1.PatchDiscussionRequest) (*compassv1beta1.PatchDiscussionResponse, error)
- func (server *APIServer) SearchAssets(ctx context.Context, req *compassv1beta1.SearchAssetsRequest) (*compassv1beta1.SearchAssetsResponse, error)
- func (server *APIServer) StarAsset(ctx context.Context, req *compassv1beta1.StarAssetRequest) (*compassv1beta1.StarAssetResponse, error)
- func (server *APIServer) SuggestAssets(ctx context.Context, req *compassv1beta1.SuggestAssetsRequest) (*compassv1beta1.SuggestAssetsResponse, error)
- func (server *APIServer) SyncAssets(ctx context.Context, req *compassv1beta1.SyncAssetsRequest) (*compassv1beta1.SyncAssetsResponse, error)
- func (server *APIServer) UnstarAsset(ctx context.Context, req *compassv1beta1.UnstarAssetRequest) (*compassv1beta1.UnstarAssetResponse, error)
- func (server *APIServer) UpdateComment(ctx context.Context, req *compassv1beta1.UpdateCommentRequest) (*compassv1beta1.UpdateCommentResponse, error)
- func (server *APIServer) UpdateTagAsset(ctx context.Context, req *compassv1beta1.UpdateTagAssetRequest) (*compassv1beta1.UpdateTagAssetResponse, error)
- func (server *APIServer) UpdateTagTemplate(ctx context.Context, req *compassv1beta1.UpdateTagTemplateRequest) (*compassv1beta1.UpdateTagTemplateResponse, error)
- func (server *APIServer) UpsertAsset(ctx context.Context, req *compassv1beta1.UpsertAssetRequest) (*compassv1beta1.UpsertAssetResponse, error)
- func (server *APIServer) UpsertPatchAsset(ctx context.Context, req *compassv1beta1.UpsertPatchAssetRequest) (*compassv1beta1.UpsertPatchAssetResponse, error)
- func (server *APIServer) ValidateUserInCtx(ctx context.Context) (string, error)
- type APIServerDeps
- type AssetService
- type DiscussionService
- type StarService
- type TagService
- type TagTemplateService
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIServer ¶
type APIServer struct { compassv1beta1.UnimplementedCompassServiceServer // contains filtered or unexported fields }
func NewAPIServer ¶
func NewAPIServer(d APIServerDeps) *APIServer
func (*APIServer) CreateAssetProbe ¶
func (server *APIServer) CreateAssetProbe(ctx context.Context, req *compassv1beta1.CreateAssetProbeRequest) (*compassv1beta1.CreateAssetProbeResponse, error)
func (*APIServer) CreateComment ¶
func (server *APIServer) CreateComment(ctx context.Context, req *compassv1beta1.CreateCommentRequest) (*compassv1beta1.CreateCommentResponse, error)
CreateComment will create a new comment of a discussion field body is mandatory
func (*APIServer) CreateDiscussion ¶
func (server *APIServer) CreateDiscussion(ctx context.Context, req *compassv1beta1.CreateDiscussionRequest) (*compassv1beta1.CreateDiscussionResponse, error)
Create will create a new discussion field title, body, and type are mandatory
func (*APIServer) CreateTagAsset ¶
func (server *APIServer) CreateTagAsset(ctx context.Context, req *compassv1beta1.CreateTagAssetRequest) (*compassv1beta1.CreateTagAssetResponse, error)
CreateTagAsset handles tag creation requests
func (*APIServer) CreateTagTemplate ¶
func (server *APIServer) CreateTagTemplate(ctx context.Context, req *compassv1beta1.CreateTagTemplateRequest) (*compassv1beta1.CreateTagTemplateResponse, error)
CreateTagTemplate handles template creation requests
func (*APIServer) DeleteAsset ¶
func (server *APIServer) DeleteAsset(ctx context.Context, req *compassv1beta1.DeleteAssetRequest) (*compassv1beta1.DeleteAssetResponse, error)
func (*APIServer) DeleteAssets ¶ added in v0.7.8
func (server *APIServer) DeleteAssets(ctx context.Context, req *compassv1beta1.DeleteAssetsRequest) (*compassv1beta1.DeleteAssetsResponse, error)
func (*APIServer) DeleteComment ¶
func (server *APIServer) DeleteComment(ctx context.Context, req *compassv1beta1.DeleteCommentRequest) (*compassv1beta1.DeleteCommentResponse, error)
DeleteComment is an api to delete a comment by discussion id
func (*APIServer) DeleteTagAsset ¶
func (server *APIServer) DeleteTagAsset(ctx context.Context, req *compassv1beta1.DeleteTagAssetRequest) (*compassv1beta1.DeleteTagAssetResponse, error)
DeleteTagAsset handles delete tag by asset and template requests
func (*APIServer) DeleteTagTemplate ¶
func (server *APIServer) DeleteTagTemplate(ctx context.Context, req *compassv1beta1.DeleteTagTemplateRequest) (*compassv1beta1.DeleteTagTemplateResponse, error)
DeleteTagTemplate handles template delete request based on URN
func (*APIServer) GetAllAssets ¶
func (server *APIServer) GetAllAssets(ctx context.Context, req *compassv1beta1.GetAllAssetsRequest) (*compassv1beta1.GetAllAssetsResponse, error)
func (*APIServer) GetAllComments ¶
func (server *APIServer) GetAllComments(ctx context.Context, req *compassv1beta1.GetAllCommentsRequest) (*compassv1beta1.GetAllCommentsResponse, error)
GetAllComments returns all comments of a discussion
func (*APIServer) GetAllDiscussions ¶
func (server *APIServer) GetAllDiscussions(ctx context.Context, req *compassv1beta1.GetAllDiscussionsRequest) (*compassv1beta1.GetAllDiscussionsResponse, error)
GetAll returns all discussion based on filter in query params supported query params are type,state,owner,assignee,asset,labels (supporterd array separated by comma) query params sort,direction to sort asc or desc query params size,offset for pagination
func (*APIServer) GetAllTagTemplates ¶
func (server *APIServer) GetAllTagTemplates(ctx context.Context, req *compassv1beta1.GetAllTagTemplatesRequest) (*compassv1beta1.GetAllTagTemplatesResponse, error)
GetAllTagTemplates handles template read requests
func (*APIServer) GetAllTagsByAsset ¶
func (server *APIServer) GetAllTagsByAsset(ctx context.Context, req *compassv1beta1.GetAllTagsByAssetRequest) (*compassv1beta1.GetAllTagsByAssetResponse, error)
GetAllTagsByAsset handles get all tags by asset requests
func (*APIServer) GetAllTypes ¶
func (server *APIServer) GetAllTypes(ctx context.Context, req *compassv1beta1.GetAllTypesRequest) (*compassv1beta1.GetAllTypesResponse, error)
func (*APIServer) GetAssetByID ¶
func (server *APIServer) GetAssetByID(ctx context.Context, req *compassv1beta1.GetAssetByIDRequest) (*compassv1beta1.GetAssetByIDResponse, error)
func (*APIServer) GetAssetByVersion ¶
func (server *APIServer) GetAssetByVersion(ctx context.Context, req *compassv1beta1.GetAssetByVersionRequest) (*compassv1beta1.GetAssetByVersionResponse, error)
func (*APIServer) GetAssetStargazers ¶
func (server *APIServer) GetAssetStargazers(ctx context.Context, req *compassv1beta1.GetAssetStargazersRequest) (*compassv1beta1.GetAssetStargazersResponse, error)
func (*APIServer) GetAssetVersionHistory ¶
func (server *APIServer) GetAssetVersionHistory(ctx context.Context, req *compassv1beta1.GetAssetVersionHistoryRequest) (*compassv1beta1.GetAssetVersionHistoryResponse, error)
func (*APIServer) GetComment ¶
func (server *APIServer) GetComment(ctx context.Context, req *compassv1beta1.GetCommentRequest) (*compassv1beta1.GetCommentResponse, error)
GetComment returns a comment discussion by id from path
func (*APIServer) GetDiscussion ¶
func (server *APIServer) GetDiscussion(ctx context.Context, req *compassv1beta1.GetDiscussionRequest) (*compassv1beta1.GetDiscussionResponse, error)
func (*APIServer) GetGraph ¶
func (server *APIServer) GetGraph(ctx context.Context, req *compassv1beta1.GetGraphRequest) (*compassv1beta1.GetGraphResponse, error)
func (*APIServer) GetMyDiscussions ¶
func (server *APIServer) GetMyDiscussions(ctx context.Context, req *compassv1beta1.GetMyDiscussionsRequest) (*compassv1beta1.GetMyDiscussionsResponse, error)
func (*APIServer) GetMyStarredAsset ¶
func (server *APIServer) GetMyStarredAsset(ctx context.Context, req *compassv1beta1.GetMyStarredAssetRequest) (*compassv1beta1.GetMyStarredAssetResponse, error)
func (*APIServer) GetMyStarredAssets ¶
func (server *APIServer) GetMyStarredAssets(ctx context.Context, req *compassv1beta1.GetMyStarredAssetsRequest) (*compassv1beta1.GetMyStarredAssetsResponse, error)
func (*APIServer) GetTagByAssetAndTemplate ¶
func (server *APIServer) GetTagByAssetAndTemplate(ctx context.Context, req *compassv1beta1.GetTagByAssetAndTemplateRequest) (*compassv1beta1.GetTagByAssetAndTemplateResponse, error)
GetTagByAssetAndTemplate handles get tag by asset requests
func (*APIServer) GetTagTemplate ¶
func (server *APIServer) GetTagTemplate(ctx context.Context, req *compassv1beta1.GetTagTemplateRequest) (*compassv1beta1.GetTagTemplateResponse, error)
GetTagTemplate handles template read requests based on URN
func (*APIServer) GetUserStarredAssets ¶
func (server *APIServer) GetUserStarredAssets(ctx context.Context, req *compassv1beta1.GetUserStarredAssetsRequest) (*compassv1beta1.GetUserStarredAssetsResponse, error)
func (*APIServer) GroupAssets ¶ added in v0.5.4
func (server *APIServer) GroupAssets(ctx context.Context, req *compassv1beta1.GroupAssetsRequest) (*compassv1beta1.GroupAssetsResponse, error)
func (*APIServer) PatchDiscussion ¶
func (server *APIServer) PatchDiscussion(ctx context.Context, req *compassv1beta1.PatchDiscussionRequest) (*compassv1beta1.PatchDiscussionResponse, error)
Patch updates a specific field in discussion empty array in assets,labels,assignees will be considered and clear all assets,labels,assignees from the discussion
func (*APIServer) SearchAssets ¶
func (server *APIServer) SearchAssets(ctx context.Context, req *compassv1beta1.SearchAssetsRequest) (*compassv1beta1.SearchAssetsResponse, error)
func (*APIServer) StarAsset ¶
func (server *APIServer) StarAsset(ctx context.Context, req *compassv1beta1.StarAssetRequest) (*compassv1beta1.StarAssetResponse, error)
func (*APIServer) SuggestAssets ¶
func (server *APIServer) SuggestAssets(ctx context.Context, req *compassv1beta1.SuggestAssetsRequest) (*compassv1beta1.SuggestAssetsResponse, error)
func (*APIServer) SyncAssets ¶ added in v0.7.0
func (server *APIServer) SyncAssets(ctx context.Context, req *compassv1beta1.SyncAssetsRequest) (*compassv1beta1.SyncAssetsResponse, error)
func (*APIServer) UnstarAsset ¶
func (server *APIServer) UnstarAsset(ctx context.Context, req *compassv1beta1.UnstarAssetRequest) (*compassv1beta1.UnstarAssetResponse, error)
func (*APIServer) UpdateComment ¶
func (server *APIServer) UpdateComment(ctx context.Context, req *compassv1beta1.UpdateCommentRequest) (*compassv1beta1.UpdateCommentResponse, error)
UpdateComment is an api to update a comment by discussion id
func (*APIServer) UpdateTagAsset ¶
func (server *APIServer) UpdateTagAsset(ctx context.Context, req *compassv1beta1.UpdateTagAssetRequest) (*compassv1beta1.UpdateTagAssetResponse, error)
UpdateTagAsset handles tag update requests
func (*APIServer) UpdateTagTemplate ¶
func (server *APIServer) UpdateTagTemplate(ctx context.Context, req *compassv1beta1.UpdateTagTemplateRequest) (*compassv1beta1.UpdateTagTemplateResponse, error)
func (*APIServer) UpsertAsset ¶
func (server *APIServer) UpsertAsset(ctx context.Context, req *compassv1beta1.UpsertAssetRequest) (*compassv1beta1.UpsertAssetResponse, error)
func (*APIServer) UpsertPatchAsset ¶
func (server *APIServer) UpsertPatchAsset(ctx context.Context, req *compassv1beta1.UpsertPatchAssetRequest) (*compassv1beta1.UpsertPatchAssetResponse, error)
type APIServerDeps ¶ added in v0.5.6
type APIServerDeps struct { AssetSvc AssetService StarSvc StarService DiscussionSvc DiscussionService TagSvc TagService TagTemplateSvc TagTemplateService UserSvc UserService Logger log.Logger }
type AssetService ¶
type AssetService interface { GetAllAssets(ctx context.Context, flt asset.Filter, withTotal bool) ([]asset.Asset, uint32, error) GetAssetByID(ctx context.Context, id string) (asset.Asset, error) GetAssetByIDWithoutProbes(ctx context.Context, id string) (asset.Asset, error) GetAssetByVersion(ctx context.Context, id, version string) (asset.Asset, error) GetAssetVersionHistory(ctx context.Context, flt asset.Filter, id string) ([]asset.Asset, error) UpsertAsset(ctx context.Context, ast *asset.Asset, upstreams, downstreams []string) (string, error) UpsertAssetWithoutLineage(ctx context.Context, ast *asset.Asset) (string, error) DeleteAsset(ctx context.Context, id string) error DeleteAssets(ctx context.Context, request asset.DeleteAssetsRequest) (uint32, error) GetLineage(ctx context.Context, urn string, query asset.LineageQuery) (asset.Lineage, error) GetTypes(ctx context.Context, flt asset.Filter) (map[asset.Type]int, error) SearchAssets(ctx context.Context, cfg asset.SearchConfig) (results []asset.SearchResult, err error) GroupAssets(ctx context.Context, cfg asset.GroupConfig) (results []asset.GroupResult, err error) SuggestAssets(ctx context.Context, cfg asset.SearchConfig) (suggestions []string, err error) AddProbe(ctx context.Context, assetURN string, probe *asset.Probe) error SyncAssets(ctx context.Context, services []string) error }
type DiscussionService ¶
type DiscussionService interface { GetDiscussions(ctx context.Context, filter discussion.Filter) ([]discussion.Discussion, error) CreateDiscussion(ctx context.Context, discussion *discussion.Discussion) (string, error) GetDiscussion(ctx context.Context, did string) (discussion.Discussion, error) PatchDiscussion(ctx context.Context, discussion *discussion.Discussion) error GetComments(ctx context.Context, discussionID string, filter discussion.Filter) ([]discussion.Comment, error) CreateComment(ctx context.Context, cmt *discussion.Comment) (string, error) GetComment(ctx context.Context, commentID, discussionID string) (discussion.Comment, error) UpdateComment(ctx context.Context, cmt *discussion.Comment) error DeleteComment(ctx context.Context, commentID, discussionID string) error }
type StarService ¶
type StarService interface { GetStarredAssetsByUserID(context.Context, star.Filter, string) ([]asset.Asset, error) GetStarredAssetByUserID(context.Context, string, string) (asset.Asset, error) GetStargazers(context.Context, star.Filter, string) ([]user.User, error) Stars(context.Context, string, string) (string, error) Unstars(context.Context, string, string) error }
type TagService ¶
type TagService interface { Validate(tag *tag.Tag) error CreateTag(ctx context.Context, tag *tag.Tag) error GetTagsByAssetID(ctx context.Context, assetID string) ([]tag.Tag, error) FindTagByAssetIDAndTemplateURN(ctx context.Context, assetID, templateURN string) (tag.Tag, error) DeleteTag(ctx context.Context, assetID, templateURN string) error UpdateTag(ctx context.Context, tag *tag.Tag) error }
type TagTemplateService ¶
type TagTemplateService interface { Validate(template tag.Template) error CreateTemplate(ctx context.Context, template *tag.Template) error GetTemplates(ctx context.Context, templateURN string) ([]tag.Template, error) UpdateTemplate(ctx context.Context, templateURN string, template *tag.Template) error GetTemplate(ctx context.Context, urn string) (tag.Template, error) DeleteTemplate(ctx context.Context, urn string) error }