Documentation ¶
Index ¶
- Variables
- func Main()
- type Document
- type Drawing
- func (p *Drawing) Add(shape Shape) (err error)
- func (p *Drawing) Delete(id ShapeID) (err error)
- func (p *Drawing) Get(id ShapeID) (shape Shape, err error)
- func (p *Drawing) GetID() string
- func (p *Drawing) List() (shapes []Shape, err error)
- func (p *Drawing) Set(id ShapeID, shape Shape) (err error)
- func (p *Drawing) SetZorder(id ShapeID, zorder string) (err error)
- func (p *Drawing) Sync(shapes []ShapeID, changes []Shape) (err error)
- type Ellipse
- type EllipseData
- type Env
- type Line
- type LineData
- type M
- type Path
- type PathData
- type Point
- type QShape
- type Rect
- type RectData
- type Service
- func (p *Service) DeleteDrawing(env *Env) (err error)
- func (p *Service) DeleteShape(env *Env) (err error)
- func (p *Service) GetDrawing(env *Env) (ret M, err error)
- func (p *Service) GetShape(env *Env) (shape Shape, err error)
- func (p *Service) PostDrawingSync(ds *serviceDrawingSync, env *Env) (err error)
- func (p *Service) PostDrawings(env *Env) (ret M, err error)
- func (p *Service) PostShape(shapeOrZorder *serviceShapeOrZorder, env *Env) (err error)
- func (p *Service) PostShapes(aShape *serviceShape, env *Env) (err error)
- type Shape
- type ShapeBase
- type ShapeID
- type ShapeStyle
- type UserID
Constants ¶
This section is empty.
Variables ¶
View Source
var DBName = "qpaint"
DBName 是默认的 QPaint Database Name。
Functions ¶
Types ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document 代表整个 QPaint DOM 的根。
type Drawing ¶
type Drawing struct {
// contains filtered or unexported fields
}
Drawing 代表用户的一个drawing文档。
type Ellipse ¶
type Ellipse struct { ShapeBase `json:",inline" bson:",inline"` EllipseData `json:"ellipse" bson:"ellipse"` }
type EllipseData ¶
type EllipseData struct { X coord `json:"x" bson:"x"` Y coord `json:"y" bson:"y"` RadiusX coord `json:"radiusX" bson:"radiusX"` RadiusY coord `json:"radiusY" bson:"radiusY"` Style ShapeStyle `json:"style" bson:"style"` }
type LineData ¶
type LineData struct { Pt1 Point `json:"pt1" bson:"pt1"` Pt2 Point `json:"pt2" bson:"pt2"` Style ShapeStyle `json:"style" bson:"style"` }
type PathData ¶
type PathData struct { Points []Point `json:"points,omitempty" bson:"points,omitempty"` Close bool `json:"close,omitempty" bson:"close,omitempty"` Style ShapeStyle `json:"style" bson:"style"` }
type RectData ¶
type RectData struct { X coord `json:"x" bson:"x"` Y coord `json:"y" bson:"y"` Width coord `json:"width" bson:"width"` Height coord `json:"height" bson:"height"` Style ShapeStyle `json:"style" bson:"style"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service 提供 RESTful API 层访问接口。
func (*Service) DeleteDrawing ¶
DeleteDrawing 删除drawing。
func (*Service) DeleteShape ¶
DeleteShape 删除一个shape。
func (*Service) GetDrawing ¶
GetDrawing 取得drawing的内容。
func (*Service) PostDrawingSync ¶
PostDrawingSync 同步客户端的修改。
func (*Service) PostDrawings ¶
PostDrawings 创建新drawing。
func (*Service) PostShapes ¶
PostShapes 创建新shape。
type ShapeStyle ¶
Click to show internal directories.
Click to hide internal directories.