mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
Move prebuilds code to enterprise top-level package, refactor into agpl pointers
Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
27
coderd/prebuilds/api.go
Normal file
27
coderd/prebuilds/api.go
Normal file
@ -0,0 +1,27 @@
|
||||
package prebuilds
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"golang.org/x/xerrors"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
)
|
||||
|
||||
type Claimer interface {
|
||||
Claim(ctx context.Context, store database.Store, userID uuid.UUID, name string, presetID uuid.UUID) (*uuid.UUID, error)
|
||||
Initiator() uuid.UUID
|
||||
}
|
||||
|
||||
type AGPLPrebuildClaimer struct{}
|
||||
|
||||
func (c AGPLPrebuildClaimer) Claim(context.Context, database.Store, uuid.UUID, string, uuid.UUID) (*uuid.UUID, error) {
|
||||
return nil, xerrors.Errorf("not entitled to claim prebuilds")
|
||||
}
|
||||
|
||||
func (c AGPLPrebuildClaimer) Initiator() uuid.UUID {
|
||||
return uuid.Nil
|
||||
}
|
||||
|
||||
var DefaultClaimer Claimer = AGPLPrebuildClaimer{}
|
Reference in New Issue
Block a user