Refactor gitlab to generic remotes
This commit is contained in:
13
internal/remotes/remote/remote.go
Normal file
13
internal/remotes/remote/remote.go
Normal file
@ -0,0 +1,13 @@
|
||||
package remote
|
||||
|
||||
import "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
|
||||
|
||||
// Any remote needs to be able to return
|
||||
// the number of projects the user has access to and also
|
||||
// stream all projects along with updates to channels
|
||||
// provided by *load.ProgressInfo
|
||||
type Remote interface {
|
||||
Name() string
|
||||
GetNumProjects(*RemoteQueryOpts) int
|
||||
StreamProjects(*RemoteQueryOpts) *load.ProgressInfo
|
||||
}
|
8
internal/remotes/remote/remote_opts.go
Normal file
8
internal/remotes/remote/remote_opts.go
Normal file
@ -0,0 +1,8 @@
|
||||
package remote
|
||||
|
||||
import "context"
|
||||
|
||||
type RemoteQueryOpts struct {
|
||||
Ctx context.Context
|
||||
OwnerOnly bool
|
||||
}
|
Reference in New Issue
Block a user