MCPcopy Create free account
hub / github.com/OpenCSGs/csghub-server / NewRecomComponent

Function NewRecomComponent

component/recom.go:22–33  ·  view source on GitHub ↗
(cfg *config.Config)

Source from the content-addressed store, hash-verified

20}
21
22func NewRecomComponent(cfg *config.Config) (*RecomComponent, error) {
23 gs, err := git.NewGitServer(cfg)
24 if err != nil {
25 return nil, fmt.Errorf("failed to init git server,%w", err)
26 }
27
28 return &RecomComponent{
29 rs: database.NewRecomStore(),
30 repos: database.NewRepoStore(),
31 gs: gs,
32 }, nil
33}
34
35func (rc *RecomComponent) SetOpWeight(ctx context.Context, repoID, weight int64) error {
36 _, err := rc.repos.FindById(ctx, repoID)

Callers 3

NewRecomHandlerFunction · 0.92
TestCalculateRecomScoreFunction · 0.85

Calls 3

NewGitServerFunction · 0.92
NewRecomStoreFunction · 0.92
NewRepoStoreFunction · 0.92

Tested by 1

TestCalculateRecomScoreFunction · 0.68