time

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package time provides time and date functions for Risor scripts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTime

func GetTime(obj object.Object) (time.Time, bool)

GetTime extracts the time.Time value from a TimeObject

func Module

func Module() *object.Module

Module returns the time module for risor

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) Equals

func (t *TimeObject) Equals(other object.Object) bool

func (*TimeObject) GetAttr

func (t *TimeObject) GetAttr(name string) (object.Object, bool)

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) SetAttr

func (t *TimeObject) SetAttr(name string, value object.Object) error

func (*TimeObject) Type

func (t *TimeObject) Type() object.Type

Jump to

Keyboard shortcuts

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