runtime.go 416 B

12345678910111213141516171819202122232425262728
  1. package budget2
  2. import "github.com/gin-gonic/gin"
  3. const (
  4. PkgType int = iota
  5. SpaceType
  6. ItemType
  7. )
  8. type Current struct {
  9. Type int
  10. SpaceId int
  11. SpaceIndex int
  12. ItemIndex int
  13. Instance *Instance
  14. }
  15. type Context struct {
  16. Order *Order
  17. C *gin.Context
  18. Current Current
  19. Cache map[string]interface{}
  20. }
  21. func (context *Context) CurrentInstance() *Instance {
  22. return context.Current.Instance
  23. }