Documentation ¶
Index ¶
- type Client
- type Controller
- func (p *Controller) Create(w http.ResponseWriter, req *http.Request)
- func (p *Controller) Get(w http.ResponseWriter, req *http.Request)
- func (p *Controller) Init() error
- func (p *Controller) InvokeObj(w http.ResponseWriter, req *http.Request)
- func (p *Controller) InvokeServiceFunc() func(w http.ResponseWriter, req *http.Request)
- func (p *Controller) InvokeServiceRawMessageFunc() func(w http.ResponseWriter, req *http.Request)
- func (p *Controller) List(w http.ResponseWriter, req *http.Request)
- func (p *Controller) Remove(w http.ResponseWriter, req *http.Request)
- func (p *Controller) SetContainer(c *brick.Container)
- func (p *Controller) Update(w http.ResponseWriter, req *http.Request)
- type OrmEvent
- type OrmEventType
- type Page
- type WatchEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { SetHeader(header, value string) Client Create(rootURL, class string, obj interface{}) (string, error) Get(rootURL, class string, id uint, assoc []string) (string, error) Query(rootURL, class string, where string, values []string, orderBy []string, page int, pageSize int) (*Page, error) InvokeService(rootURL, class, method string, args ...interface{}) (string, error) }
Client is client api for rest controller
type Controller ¶
type Controller struct { brick.Trigger DB orm.DBService `inject:"DB"` ModelRegistry orm.ModelRegistry `inject:"DB"` // contains filtered or unexported fields }
Controller ...
func (*Controller) Create ¶
func (p *Controller) Create(w http.ResponseWriter, req *http.Request)
Create resource create func
func (*Controller) Get ¶
func (p *Controller) Get(w http.ResponseWriter, req *http.Request)
Get get one obj. query params: assocations=a,b...
func (*Controller) InvokeObj ¶
func (p *Controller) InvokeObj(w http.ResponseWriter, req *http.Request)
InvokeObj executing RPC API Method
func (*Controller) InvokeServiceFunc ¶
func (p *Controller) InvokeServiceFunc() func(w http.ResponseWriter, req *http.Request)
InvokeServiceFunc call the func of service
func (*Controller) InvokeServiceRawMessageFunc ¶
func (p *Controller) InvokeServiceRawMessageFunc() func(w http.ResponseWriter, req *http.Request)
InvokeServiceRawMessageFunc call the func of service with json.RawMessage
func (*Controller) List ¶
func (p *Controller) List(w http.ResponseWriter, req *http.Request)
List query data list
func (*Controller) Remove ¶
func (p *Controller) Remove(w http.ResponseWriter, req *http.Request)
Remove resource remove func
func (*Controller) SetContainer ¶
func (p *Controller) SetContainer(c *brick.Container)
SetContainer ...
func (*Controller) Update ¶
func (p *Controller) Update(w http.ResponseWriter, req *http.Request)
Update rest api update func
type OrmEvent ¶
type OrmEvent struct { EventType OrmEventType `json:"eventType"` Class class `json:"class"` Data interface{} `json:"data"` ID interface{} `json:"id"` //the id of object that has been deleted. it's nil if EventType isn't ormDelete }
OrmEvent ...
func NewOrmEvent ¶
func NewOrmEvent(eventType OrmEventType, className class, data interface{}) *OrmEvent
NewOrmEvent return OrmEvent object
type Page ¶
type Page struct { Data json.RawMessage `json:"data"` Page int `json:"page"` PageCount int `json:"pageCount"` PageSize int `json:"pageSize"` }
Page rest response body
type WatchEvent ¶
WatchEvent ...
Click to show internal directories.
Click to hide internal directories.