handlersv1beta1

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

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) CreateComment

CreateComment will create a new comment of a discussion field body is mandatory

func (*APIServer) CreateDiscussion

Create will create a new discussion field title, body, and type are mandatory

func (*APIServer) CreateTagAsset

CreateTagAsset handles tag creation requests

func (*APIServer) CreateTagTemplate

CreateTagTemplate handles template creation requests

func (*APIServer) DeleteAsset

func (*APIServer) DeleteComment

DeleteComment is an api to delete a comment by discussion id

func (*APIServer) DeleteTagAsset

DeleteTagAsset handles delete tag by asset and template requests

func (*APIServer) DeleteTagTemplate

DeleteTagTemplate handles template delete request based on URN

func (*APIServer) GetAllComments

GetAllComments returns all comments of a discussion

func (*APIServer) GetAllDiscussions

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

GetAllTagTemplates handles template read requests

func (*APIServer) GetAllTagsByAsset

GetAllTagsByAsset handles get all tags by asset requests

func (*APIServer) GetAllTypes

func (*APIServer) GetComment

GetComment returns a comment discussion by id from path

func (*APIServer) GetGraph

func (*APIServer) GetTagByAssetAndTemplate

GetTagByAssetAndTemplate handles get tag by asset requests

func (*APIServer) GetTagTemplate

GetTagTemplate handles template read requests based on URN

func (*APIServer) GroupAssets added in v0.5.4

func (*APIServer) PatchDiscussion

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) StarAsset

func (*APIServer) SyncAssets added in v0.7.0

func (*APIServer) UnstarAsset

func (*APIServer) UpdateComment

UpdateComment is an api to update a comment by discussion id

func (*APIServer) UpdateTagAsset

UpdateTagAsset handles tag update requests

func (*APIServer) UpsertAsset

func (*APIServer) ValidateUserInCtx added in v0.5.6

func (server *APIServer) ValidateUserInCtx(ctx context.Context) (string, 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

	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
}

type UserService

type UserService interface {
	ValidateUser(ctx context.Context, uuid, email string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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