Skip to content

Commit

Permalink
add repository provider getter
Browse files Browse the repository at this point in the history
  • Loading branch information
MRtecno98 committed Jul 31, 2024
1 parent 6a9e461 commit d7a991c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bucket/repositories/modrinth.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ func NewModrinthRepository(lock context.Context, context *bucket.OpenContext) *M
}
}

func (r *Modrinth) Provider() string {
return MODRINTH_REPOSITORY
}

func (r *Modrinth) makreq() *resty.Request {
return r.HttpClient.R().SetContext(r.Lock)
}
Expand Down
4 changes: 4 additions & 0 deletions bucket/repositories/spigotmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ func NewSpigotRepository(ctx context.Context, context *bucket.OpenContext) *Spig
}
}

func (r *SpigotMC) Provider() string {
return SPIGOTMC_REPOSITORY
}

func (r *SpigotMC) Resolve(plugin bucket.Plugin) (bucket.RemotePlugin, []bucket.RemotePlugin, error) {
var tot int
var res []bucket.RemotePlugin
Expand Down
2 changes: 2 additions & 0 deletions bucket/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

type Repository interface {
Provider() string

Search(query string, max int) ([]RemotePlugin, int, error)
SearchAll(query string, max int) ([]RemotePlugin, int, error)

Expand Down

0 comments on commit d7a991c

Please sign in to comment.