-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the release storage interface (#1107)
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package release | ||
|
||
import ( | ||
v1 "kusionstack.io/kusion/pkg/apis/api.kusion.io/v1" | ||
) | ||
|
||
// Storage is used to provide storage service for multiple releases. | ||
type Storage interface { | ||
// Get returns a specified Release which is determined by the group of Project, Workspace | ||
// and Revision. | ||
Get(project, workspace string, revision uint64) (*v1.Release, error) | ||
|
||
// GetRevisions returns the Revisions of a specified Project and Workspace. | ||
GetRevisions(project, workspace string) ([]uint64, error) | ||
|
||
// GetStackBoundRevisions returns the Revisions of a specified Project, Stack and Workspace. | ||
GetStackBoundRevisions(project, stack, workspace string) ([]uint64, error) | ||
|
||
// GetLatestRevision returns the latest State which corresponds to the current infra Resources. | ||
GetLatestRevision(project, workspace string) (uint64, error) | ||
|
||
// Create creates a new Release in the Storage. | ||
Create(release *v1.Release) error | ||
|
||
// Update updates an existing Release in the Storage. | ||
Update(release *v1.Release) error | ||
} |