Documentation ¶
Index ¶
- func AddHelmDispatcher(prefix string, app *appsrv.Application)
- func AddMiscDispatcher(prefix string, app *appsrv.Application)
- func AddRawResourceDispatcher(prefix string, app *appsrv.Application)
- func AddResourceDispatcher(prefix string, app *appsrv.Application, handler IK8sResourceHandler)
- func GetConfig(kubeConfigFile string) (*rest.Config, error)
- func NewCloudK8sRequest(ctx context.Context, query, data *jsonutils.JSONDict) (*common.Request, error)
- func NewCommonRequest(ctx context.Context, w http.ResponseWriter, r *http.Request) (*common.Request, error)
- func SendJSON(w http.ResponseWriter, obj interface{})
- func SendYAML(w http.ResponseWriter, obj runtime.Object)
- type IK8sResourceHandler
- type IK8sResourceManager
- type K8sResourceHandler
- func (h *K8sResourceHandler) Create(ctx context.Context, query, data *jsonutils.JSONDict) (interface{}, error)
- func (h *K8sResourceHandler) Delete(ctx context.Context, id string, query, data *jsonutils.JSONDict) error
- func (h *K8sResourceHandler) Filter(f appsrv.FilterHandler) appsrv.FilterHandler
- func (h *K8sResourceHandler) Get(ctx context.Context, id string, query *jsonutils.JSONDict) (interface{}, error)
- func (h *K8sResourceHandler) GetSpecific(ctx context.Context, id, spec string, query *jsonutils.JSONDict) (interface{}, error)
- func (h *K8sResourceHandler) Keyword() string
- func (h *K8sResourceHandler) KeywordPlural() string
- func (h *K8sResourceHandler) List(ctx context.Context, query *jsonutils.JSONDict) (common.ListResource, error)
- func (h *K8sResourceHandler) PerformAction(ctx context.Context, id, action string, query, data *jsonutils.JSONDict) (interface{}, error)
- func (h *K8sResourceHandler) PerformClassAction(ctx context.Context, action string, query, data *jsonutils.JSONDict) (interface{}, error)
- func (h *K8sResourceHandler) Update(ctx context.Context, id string, query, data *jsonutils.JSONDict) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHelmDispatcher ¶
func AddHelmDispatcher(prefix string, app *appsrv.Application)
const (
DefaultTillerImage = "yunion/tiller:v2.9.0"
)
func AddMiscDispatcher ¶
func AddMiscDispatcher(prefix string, app *appsrv.Application)
func AddRawResourceDispatcher ¶
func AddRawResourceDispatcher(prefix string, app *appsrv.Application)
func AddResourceDispatcher ¶
func AddResourceDispatcher(prefix string, app *appsrv.Application, handler IK8sResourceHandler)
func NewCloudK8sRequest ¶
func NewCommonRequest ¶
func SendJSON ¶
func SendJSON(w http.ResponseWriter, obj interface{})
Types ¶
type IK8sResourceHandler ¶
type IK8sResourceHandler interface { dispatcher.IMiddlewareFilter Keyword() string KeywordPlural() string List(ctx context.Context, query *jsonutils.JSONDict) (common.ListResource, error) Get(ctx context.Context, id string, query *jsonutils.JSONDict) (interface{}, error) GetSpecific(ctx context.Context, id, spec string, query *jsonutils.JSONDict) (interface{}, error) Create(ctx context.Context, query *jsonutils.JSONDict, data *jsonutils.JSONDict) (interface{}, error) PerformClassAction(ctx context.Context, action string, query, data *jsonutils.JSONDict) (interface{}, error) PerformAction(ctx context.Context, id, action string, query, data *jsonutils.JSONDict) (interface{}, error) Update(ctx context.Context, id string, query *jsonutils.JSONDict, data *jsonutils.JSONDict) (interface{}, error) Delete(ctx context.Context, id string, query *jsonutils.JSONDict, data *jsonutils.JSONDict) error }
type IK8sResourceManager ¶
type IK8sResourceManager interface { Keyword() string KeywordPlural() string InNamespace() bool // list hooks AllowListItems(req *common.Request) bool List(req *common.Request) (common.ListResource, error) // get hooks AllowGetItem(req *common.Request, id string) bool Get(req *common.Request, id string) (interface{}, error) // create hooks AllowCreateItem(req *common.Request) bool ValidateCreateData(req *common.Request) error Create(req *common.Request) (interface{}, error) // update hooks AllowUpdateItem(req *common.Request, id string) bool Update(req *common.Request, id string) (interface{}, error) // delete hooks AllowDeleteItem(req *common.Request, id string) bool Delete(req *common.Request, id string) error IsRawResource() bool }
type K8sResourceHandler ¶
type K8sResourceHandler struct {
// contains filtered or unexported fields
}
func NewK8sResourceHandler ¶
func NewK8sResourceHandler(man IK8sResourceManager) *K8sResourceHandler
func (*K8sResourceHandler) Filter ¶
func (h *K8sResourceHandler) Filter(f appsrv.FilterHandler) appsrv.FilterHandler
func (*K8sResourceHandler) GetSpecific ¶
func (*K8sResourceHandler) Keyword ¶
func (h *K8sResourceHandler) Keyword() string
func (*K8sResourceHandler) KeywordPlural ¶
func (h *K8sResourceHandler) KeywordPlural() string
func (*K8sResourceHandler) List ¶
func (h *K8sResourceHandler) List(ctx context.Context, query *jsonutils.JSONDict) (common.ListResource, error)
func (*K8sResourceHandler) PerformAction ¶
func (*K8sResourceHandler) PerformClassAction ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.