@ -19,9 +19,10 @@ client for multiple providers and domains.
- For a given **Organization**:
- For a given **Organization**:
- **Teams**: `GET` and `LIST`
- **Teams**: `GET` and `LIST`
- **Repositories**: `GET`, `LIST` and `POST`
- **Repositories**: `GET`, `LIST` and `POST`
- **Teams**: `ADD` and `REMOVE`
- **Team Access**: `LIST`, `POST` and `DELETE`
- **Credentials**: `GET`, `LIST` and `POST`
- **Credentials**: `LIST`, `POST` and `DELETE`
- Support sub-organizations (or "sub-groups" in GitLab) if possible
- Support sub-organizations (or "sub-groups" in GitLab) if possible
- Support reconciling an object for idempotent operations
- Pagination is automatically handled for `LIST` requests
- Pagination is automatically handled for `LIST` requests
- Transparently can manage teams (collections of users, sub-groups in Gitlab) with varying access to repos
- Transparently can manage teams (collections of users, sub-groups in Gitlab) with varying access to repos
- Follow library best practices in order to be easy to vendor (e.g. use major `vX` versioning & go.mod)
- Follow library best practices in order to be easy to vendor (e.g. use major `vX` versioning & go.mod)
@ -43,7 +44,6 @@ client for multiple providers and domains.
- It should be possible to create a fake API client for testing, implementing the same interfaces
- It should be possible to create a fake API client for testing, implementing the same interfaces
- All type structs shall have a `Validate()` method, and optionally a `Default()` one
- All type structs shall have a `Validate()` method, and optionally a `Default()` one
- All type structs shall expose their internal representation (from the underlying library) through the `InternalGetter` interface with a method `GetInternal() interface{}`
- All type structs shall expose their internal representation (from the underlying library) through the `InternalGetter` interface with a method `GetInternal() interface{}`
- By default, mutating methods (e.g. `Create()`) shall be idempotent, unless opted out in `*CreateOptions` field.
- Typed errors shall be returned, wrapped using Go 1.14's new features
- Typed errors shall be returned, wrapped using Go 1.14's new features
- Go-style enums are used when there are only a few supported values for a field
- Go-style enums are used when there are only a few supported values for a field
- Every field is documented using Godoc comment, including `+required` or `+optional` to clearly signify its importance
- Every field is documented using Godoc comment, including `+required` or `+optional` to clearly signify its importance
@ -194,6 +194,7 @@ The `OrganizationsClient` provides access to a set of organizations, as follows:
type OrganizationsClient interface {
type OrganizationsClient interface {
// Get a specific organization the user has access to
// Get a specific organization the user has access to
// This might also refer to a sub-organization
// This might also refer to a sub-organization
// ErrNotFound is returned if the resource does not exist
Get(ctx context.Context, o OrganizationRef) (*Organization, error)
Get(ctx context.Context, o OrganizationRef) (*Organization, error)
// List all top-level organizations the specific user has access to
// List all top-level organizations the specific user has access to
@ -219,6 +220,7 @@ type Organization struct {
// (Domain, Organization and SubOrganizations) required for being an OrganizationRef
// (Domain, Organization and SubOrganizations) required for being an OrganizationRef
OrganizationInfo `json:",inline"`
OrganizationInfo `json:",inline"`
// InternalHolder implements the InternalGetter interface
// InternalHolder implements the InternalGetter interface
// +optional
InternalHolder `json:",inline"`
InternalHolder `json:",inline"`
// Name is the human-friendly name of this organization, e.g. "Weaveworks" or "Kubernetes SIGs"
// Name is the human-friendly name of this organization, e.g. "Weaveworks" or "Kubernetes SIGs"
@ -273,6 +275,7 @@ type OrganizationTeamsClient interface {
// Get a team within the specific organization
// Get a team within the specific organization
// teamName may include slashes, to point to e.g. "sub-teams" i.e. subgroups in Gitlab
// teamName may include slashes, to point to e.g. "sub-teams" i.e. subgroups in Gitlab
// teamName must not be an empty string
// teamName must not be an empty string
// ErrNotFound is returned if the resource does not exist