2022-04-25 00:03:26 +00:00
|
|
|
package common
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"runner-manager/params"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Store interface {
|
2022-04-28 16:13:20 +00:00
|
|
|
CreateRepository(ctx context.Context, owner, name, credentialsName, webhookSecret string) (params.Repository, error)
|
2022-04-26 20:29:58 +00:00
|
|
|
GetRepository(ctx context.Context, owner, name string) (params.Repository, error)
|
2022-04-25 00:03:26 +00:00
|
|
|
ListRepositories(ctx context.Context) ([]params.Repository, error)
|
2022-04-26 20:29:58 +00:00
|
|
|
DeleteRepository(ctx context.Context, owner, name string) error
|
2022-04-25 00:03:26 +00:00
|
|
|
|
2022-04-28 16:13:20 +00:00
|
|
|
CreateOrganization(ctx context.Context, name, credentialsName, webhookSecret string) (params.Organization, error)
|
2022-04-26 20:29:58 +00:00
|
|
|
GetOrganization(ctx context.Context, name string) (params.Organization, error)
|
2022-04-25 00:03:26 +00:00
|
|
|
ListOrganizations(ctx context.Context) ([]params.Organization, error)
|
2022-04-26 20:29:58 +00:00
|
|
|
DeleteOrganization(ctx context.Context, name string) error
|
2022-04-25 00:03:26 +00:00
|
|
|
|
|
|
|
|
CreateRepositoryPool(ctx context.Context, repoId string, param params.CreatePoolParams) (params.Pool, error)
|
|
|
|
|
CreateOrganizationPool(ctx context.Context, orgId string, param params.CreatePoolParams) (params.Pool, error)
|
|
|
|
|
|
|
|
|
|
GetRepositoryPool(ctx context.Context, repoID, poolID string) (params.Pool, error)
|
|
|
|
|
GetOrganizationPool(ctx context.Context, orgID, poolID string) (params.Pool, error)
|
|
|
|
|
|
|
|
|
|
DeleteRepositoryPool(ctx context.Context, repoID, poolID string) error
|
|
|
|
|
DeleteOrganizationPool(ctx context.Context, orgID, poolID string) error
|
|
|
|
|
|
2022-04-26 20:29:58 +00:00
|
|
|
UpdateRepositoryPool(ctx context.Context, repoID, poolID string, param params.UpdatePoolParams) (params.Pool, error)
|
|
|
|
|
UpdateOrganizationPool(ctx context.Context, orgID, poolID string, param params.UpdatePoolParams) (params.Pool, error)
|
|
|
|
|
|
|
|
|
|
FindRepositoryPoolByTags(ctx context.Context, repoID string, tags []string) (params.Pool, error)
|
|
|
|
|
FindOrganizationPoolByTags(ctx context.Context, orgID string, tags []string) (params.Pool, error)
|
|
|
|
|
|
|
|
|
|
CreateInstance(ctx context.Context, poolID string, param params.CreateInstanceParams) (params.Instance, error)
|
|
|
|
|
DeleteInstance(ctx context.Context, poolID string, instanceID string) error
|
|
|
|
|
UpdateInstance(ctx context.Context, instanceID string, param params.UpdateInstanceParams) (params.Instance, error)
|
|
|
|
|
|
|
|
|
|
ListInstances(ctx context.Context, poolID string) ([]params.Instance, error)
|
|
|
|
|
ListRepoInstances(ctx context.Context, repoID string) ([]params.Instance, error)
|
|
|
|
|
ListOrgInstances(ctx context.Context, orgID string) ([]params.Instance, error)
|
|
|
|
|
|
2022-04-27 16:56:28 +00:00
|
|
|
// GetInstance(ctx context.Context, poolID string, instanceID string) (params.Instance, error)
|
|
|
|
|
GetInstanceByName(ctx context.Context, poolID string, instanceName string) (params.Instance, error)
|
2022-04-28 16:13:20 +00:00
|
|
|
|
|
|
|
|
CreateUser(ctx context.Context, user params.NewUserParams) (params.User, error)
|
|
|
|
|
GetUser(ctx context.Context, user string) (params.User, error)
|
|
|
|
|
UpdateUser(ctx context.Context, user string, param params.UpdateUserParams) (params.User, error)
|
|
|
|
|
HasAdminUser(ctx context.Context) bool
|
|
|
|
|
|
|
|
|
|
ControllerInfo() (params.ControllerInfo, error)
|
|
|
|
|
InitController() (params.ControllerInfo, error)
|
2022-04-25 00:03:26 +00:00
|
|
|
}
|