Documentation ¶
Index ¶
- func NewRouter(appCtx *AppContext, controllers []Controller) *mux.Router
- type AppContext
- type ApplicationsController
- type Controller
- type ErrorMessage
- type Handler
- type ProjectsController
- func (c *ProjectsController) CreateProject(r *http.Request, vars map[string]string, body interface{}) *Response
- func (c *ProjectsController) GetProject(r *http.Request, vars map[string]string, body interface{}) *Response
- func (c *ProjectsController) ListProjects(r *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *ProjectsController) Routes() []Route
- func (c *ProjectsController) UpdateProject(r *http.Request, vars map[string]string, body interface{}) *Response
- type Response
- func BadRequest(msg string) *Response
- func Conflict(msg string) *Response
- func Created(data interface{}) *Response
- func Error(code int, msg string) *Response
- func Forbidden(msg string) *Response
- func FromError(err error) *Response
- func InternalServerError(msg string) *Response
- func NoContent() *Response
- func NotFound(msg string) *Response
- func Ok(data interface{}) *Response
- type Route
- type SecretStoragesController
- func (c *SecretStoragesController) CreateSecretStorage(_ *http.Request, vars map[string]string, body interface{}) *Response
- func (c *SecretStoragesController) DeleteSecretStorage(_ *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *SecretStoragesController) GetSecretStorage(_ *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *SecretStoragesController) ListSecretStorage(_ *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *SecretStoragesController) Routes() []Route
- func (c *SecretStoragesController) UpdateSecretStorage(_ *http.Request, vars map[string]string, body interface{}) *Response
- type SecretsController
- func (c *SecretsController) CreateSecret(r *http.Request, vars map[string]string, body interface{}) *Response
- func (c *SecretsController) DeleteSecret(r *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *SecretsController) GetSecret(r *http.Request, vars map[string]string, _ interface{}) *Response
- func (c *SecretsController) ListSecret(r *http.Request, vars map[string]string, body interface{}) *Response
- func (c *SecretsController) Routes() []Route
- func (c *SecretsController) UpdateSecret(r *http.Request, vars map[string]string, body interface{}) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(appCtx *AppContext, controllers []Controller) *mux.Router
Types ¶
type AppContext ¶
type AppContext struct { ApplicationService service.ApplicationService ProjectsService service.ProjectsService SecretService service.SecretService SecretStorageService service.SecretStorageService DefaultSecretStorage *models.SecretStorage AuthorizationEnabled bool UseAuthorizationMiddleware bool Enforcer enforcer.Enforcer }
func NewAppContext ¶
type ApplicationsController ¶
type ApplicationsController struct {
*AppContext
}
func (*ApplicationsController) ListApplications ¶
func (*ApplicationsController) Routes ¶
func (c *ApplicationsController) Routes() []Route
type Controller ¶
type Controller interface {
Routes() []Route
}
type ErrorMessage ¶
type ErrorMessage struct {
Message string `json:"error"`
}
type Handler ¶
type Handler func(r *http.Request, vars map[string]string, body interface{}) *Response
type ProjectsController ¶
type ProjectsController struct {
*AppContext
}
func (*ProjectsController) CreateProject ¶
func (*ProjectsController) GetProject ¶
func (*ProjectsController) ListProjects ¶
func (*ProjectsController) Routes ¶
func (c *ProjectsController) Routes() []Route
func (*ProjectsController) UpdateProject ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func BadRequest ¶
func InternalServerError ¶
func (*Response) WriteTo ¶
func (r *Response) WriteTo(w http.ResponseWriter)
type Route ¶
func (Route) HandlerFunc ¶
func (route Route) HandlerFunc(validate *validator.Validate) http.HandlerFunc
type SecretStoragesController ¶ added in v1.8.0
type SecretStoragesController struct {
*AppContext
}
func (*SecretStoragesController) CreateSecretStorage ¶ added in v1.8.0
func (c *SecretStoragesController) CreateSecretStorage(_ *http.Request, vars map[string]string, body interface{}) *Response
CreateSecretStorage creates a secret storage for a project
func (*SecretStoragesController) DeleteSecretStorage ¶ added in v1.8.0
func (*SecretStoragesController) GetSecretStorage ¶ added in v1.8.0
func (c *SecretStoragesController) GetSecretStorage(_ *http.Request, vars map[string]string, _ interface{}) *Response
GetSecretStorage gets a secret storage given specified project_id and secret_storage_id
func (*SecretStoragesController) ListSecretStorage ¶ added in v1.8.0
func (c *SecretStoragesController) ListSecretStorage(_ *http.Request, vars map[string]string, _ interface{}) *Response
ListSecretStorage lists all secret storage for a project including the global secret storage
func (*SecretStoragesController) Routes ¶ added in v1.8.0
func (c *SecretStoragesController) Routes() []Route
func (*SecretStoragesController) UpdateSecretStorage ¶ added in v1.8.0
func (c *SecretStoragesController) UpdateSecretStorage(_ *http.Request, vars map[string]string, body interface{}) *Response
UpdateSecretStorage updates a secret storage given specified project_id and secret_storage_id Note: cannot update global secret storage
type SecretsController ¶
type SecretsController struct {
*AppContext
}
func (*SecretsController) CreateSecret ¶
func (*SecretsController) DeleteSecret ¶
func (*SecretsController) ListSecret ¶
func (*SecretsController) Routes ¶
func (c *SecretsController) Routes() []Route
func (*SecretsController) UpdateSecret ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.