Add method to check organization membership (#1037)

* Add remote method to check organization membership
* Use named return parameters in interface
* Add membership check service
* Update Gitea SDK
This commit is contained in:
Lauris BH
2022-07-25 04:09:35 +03:00
committed by GitHub
parent 1e8d4cc455
commit 19dfc331f4
19 changed files with 342 additions and 14 deletions

View File

@@ -33,6 +33,7 @@ import (
"golang.org/x/sync/errgroup"
"github.com/woodpecker-ci/woodpecker/server"
"github.com/woodpecker-ci/woodpecker/server/cache"
"github.com/woodpecker-ci/woodpecker/server/model"
"github.com/woodpecker-ci/woodpecker/server/plugins/environments"
"github.com/woodpecker-ci/woodpecker/server/plugins/registry"
@@ -180,6 +181,10 @@ func setupEnvironService(c *cli.Context, s store.Store) model.EnvironService {
return environments.Parse(c.StringSlice("environment"))
}
func setupMembershipService(_ *cli.Context, r remote.Remote) cache.MembershipService {
return cache.NewMembershipService(r)
}
// setupRemote helper function to setup the remote from the CLI arguments.
func setupRemote(c *cli.Context) (remote.Remote, error) {
switch {