api

package
v3.0.8-alpha.10+incomp... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest

type APIRequest struct {
	AppID    string      `json:"appID"`
	Operator string      `json:"operator"`
	Request  interface{} `json:"request"`
}

type APIResource

type APIResource struct {
	ConfigData   []byte
	Config       string
	URL          string
	IsCliSSL     bool
	CliTLS       *tls.Config
	Actions      []*httpserver.Action
	GlobalFilter func(req *restful.Request, resp *restful.Response, fchain *restful.FilterChain)
	Wactions     []*webserver.Action
	MetaCli      storage.DI
	InstCli      storage.DI
	CacheCli     storage.DI
	Error        errors.CCErrorIf
	HostCtrl     func() string
	ObjCtrl      func() string
	ProcCtrl     func() string
	EventCtrl    func() string
	AuditCtrl    func() string
	HostAPI      func() string
	TopoAPI      func() string
	ProcAPI      func() string
	EventAPI     func() string
	APIAddr      func() string
	AddrSrv      AddrSrv
	Lang         language.CCLanguageIf
}

func GetAPIResource

func GetAPIResource() *APIResource

func NewAPIResource

func NewAPIResource() *APIResource

func (*APIResource) CreateAPIRspErrStrWithData

func (a *APIResource) CreateAPIRspErrStrWithData(errcode int, strmsg, errdata interface{}) (string, error)

CreateAPIRspErrStrWithData create api rsp str return errorno, errormsg, errdata

func (*APIResource) CreateAPIRspStr

func (a *APIResource) CreateAPIRspStr(errcode int, info interface{}) (string, error)

CreateAPIRspStr create api rsp str

func (*APIResource) CreateBKAPIRspStr

func (a *APIResource) CreateBKAPIRspStr(errcode int, info interface{}) (string, error)

CreateBKAPIRspStr create blueking api rsp str

func (*APIResource) GetClientSSL

func (a *APIResource) GetClientSSL() *tls.Config

func (*APIResource) GetDataCli

func (a *APIResource) GetDataCli(config map[string]string, dType string) error

GetDataCli get data cli

func (*APIResource) InitAction

func (a *APIResource) InitAction()

func (*APIResource) InitWaction

func (a *APIResource) InitWaction()

func (*APIResource) IsClientSSL

func (a *APIResource) IsClientSSL() bool

func (*APIResource) ParseConf

func (a *APIResource) ParseConf(data []byte) (map[string]string, error)

func (*APIResource) ParseConfig

func (a *APIResource) ParseConfig() (map[string]string, error)

func (*APIResource) PreProcess

func (a *APIResource) PreProcess(data []byte) (string, error)

func (*APIResource) RunAutoAction

func (a *APIResource) RunAutoAction(config map[string]string) error

RunAutoAction call the callback function when the server starts

func (*APIResource) SetConfig

func (a *APIResource) SetConfig(conf *config.CCAPIConfig)

type APIRsp

type APIRsp struct {
	HTTPCode int         `json:"-"`
	Result   bool        `json:"result"`
	Code     int         `json:"bk_error_code"`
	Message  interface{} `json:"bk_error_msg"`
	Data     interface{} `json:"data"`
}

type AddrSrv

type AddrSrv interface {
	GetServer(servType string) (string, error)
}

AddrSrv get server address interface

type BKAPIRsp

type BKAPIRsp struct {
	HTTPCode int         `json:"-"`
	Result   bool        `json:"result"`
	Code     int         `json:"bk_error_code"`
	Message  interface{} `json:"bk_error_msg"`
	Data     interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL