Documentation
¶
Overview ¶
Package time provides time and date functions for Risor scripts.
Index ¶
- func GetTime(obj object.Object) (time.Time, bool)
- func Module() *object.Module
- type TimeObject
- func (t *TimeObject) Attrs() []object.AttrSpec
- func (t *TimeObject) Cost() int
- func (t *TimeObject) Equals(other object.Object) bool
- func (t *TimeObject) GetAttr(name string) (object.Object, bool)
- func (t *TimeObject) Inspect() string
- func (t *TimeObject) Interface() interface{}
- func (t *TimeObject) IsTruthy() bool
- func (t *TimeObject) MarshalJSON() ([]byte, error)
- func (t *TimeObject) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)
- func (t *TimeObject) SetAttr(name string, value object.Object) error
- func (t *TimeObject) Type() object.Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TimeObject ¶
type TimeObject struct {
// contains filtered or unexported fields
}
TimeObject wraps a Go time.Time for Risor
func NewTimeObject ¶
func NewTimeObject(t time.Time) *TimeObject
func (*TimeObject) Attrs ¶
func (t *TimeObject) Attrs() []object.AttrSpec
func (*TimeObject) Cost ¶
func (t *TimeObject) Cost() int
func (*TimeObject) Inspect ¶
func (t *TimeObject) Inspect() string
func (*TimeObject) Interface ¶
func (t *TimeObject) Interface() interface{}
func (*TimeObject) IsTruthy ¶
func (t *TimeObject) IsTruthy() bool
func (*TimeObject) MarshalJSON ¶
func (t *TimeObject) MarshalJSON() ([]byte, error)
func (*TimeObject) RunOperation ¶
func (t *TimeObject) RunOperation(opType op.BinaryOpType, right object.Object) (object.Object, error)
func (*TimeObject) Type ¶
func (t *TimeObject) Type() object.Type
Click to show internal directories.
Click to hide internal directories.