Documentation ¶
Index ¶
- Constants
- func FetchProjectID(ctx context.Context, val string) string
- func IsValidProjectID(ctx context.Context, projectID string) bool
- type Core
- func (c *Core) CreateProject(ctx context.Context, m *Model) error
- func (c *Core) DeleteProject(ctx context.Context, m *Model) error
- func (c *Core) Exists(ctx context.Context, key string) (bool, error)
- func (c *Core) ExistsWithID(ctx context.Context, id string) (bool, error)
- func (c *Core) Get(ctx context.Context, projectID string) (*Model, error)
- func (c *Core) ListKeys(ctx context.Context) ([]string, error)
- type ICore
- type IRepo
- type Model
- type Repo
Constants ¶
View Source
const (
// Prefix for all project keys in the registry
Prefix = "projects/"
)
Variables ¶
This section is empty.
Functions ¶
func FetchProjectID ¶
FetchProjectID returns the key for storing in the registry
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core implements all business logic for project
func (*Core) CreateProject ¶
CreateProject creates a new project
func (*Core) DeleteProject ¶
DeleteProject deletes a project and all resources in it
func (*Core) ExistsWithID ¶
ExistsWithID to check if the project exists with the projectID
type ICore ¶
type ICore interface { CreateProject(ctx context.Context, m *Model) error Get(ctx context.Context, key string) (*Model, error) ListKeys(ctx context.Context) ([]string, error) Exists(ctx context.Context, key string) (bool, error) ExistsWithID(ctx context.Context, id string) (bool, error) DeleteProject(ctx context.Context, m *Model) error }
ICore is an interface over project core
type Model ¶
type Model struct { common.BaseModel Name string `json:"name"` ProjectID string `json:"project_id"` Labels map[string]string `json:"labels"` }
Model for a project
func GetValidatedModelForCreate ¶
GetValidatedModelForCreate validates an incoming proto request and returns a project model for create requests
func GetValidatedModelForDelete ¶
GetValidatedModelForDelete validates an incoming proto request and returns a project model for delete requests
Click to show internal directories.
Click to hide internal directories.