time

package module
v0.0.0-...-0aba77e Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: MIT Imports: 4 Imported by: 0

README

time

time.Time translations for google/skylark

Documentation

Overview

Package time provides time.Time wrappers for the skylark embedded language.

Index

Constants

This section is empty.

Variables

View Source
var Zero = Time(time.Time{})

Zero is the zero time.

Functions

func Delta

func Delta(_ *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Delta returns a duration created from kwargs. Expected "hours", "minutes", "seconds", "milliseconds", or "nanoseconds", and assigned an int.

func Now

func Now(_ *skylark.Thread, _ *skylark.Builtin, args skylark.Tuple, kwargs []skylark.Tuple) (skylark.Value, error)

Now returns the current Time.

Types

type Duration

type Duration time.Duration

Duration represents a span of time.

func (Duration) Binary

func (d Duration) Binary(op syntax.Token, y skylark.Value, side skylark.Side) (skylark.Value, error)

Binary implements binary operators.

func (Duration) CompareSameType

func (d Duration) CompareSameType(op syntax.Token, y skylark.Value, depth int) (bool, error)

CompareSameType compares this Time to another.

func (Duration) Freeze

func (d Duration) Freeze()

Freeze makes the value immutable.

func (Duration) Hash

func (d Duration) Hash() (uint32, error)

Hash returns a hash of the value for used in sorting.

func (Duration) String

func (d Duration) String() string

String returns the string representation of this Time.

func (Duration) Truth

func (d Duration) Truth() skylark.Bool

Truth reports the python-truthiness of the value.

func (Duration) Type

func (d Duration) Type() string

Type returns the typename of the value.

type Time

type Time time.Time

Time is the type of a Skylark time.Time.

func (Time) Binary

func (t Time) Binary(op syntax.Token, y skylark.Value, side skylark.Side) (skylark.Value, error)

Binary implements binary operators.

func (Time) CompareSameType

func (t Time) CompareSameType(op syntax.Token, y skylark.Value, depth int) (bool, error)

CompareSameType compares this Time to another.

func (Time) Freeze

func (t Time) Freeze()

Freeze makes the value immutable.

func (Time) Hash

func (t Time) Hash() (uint32, error)

Hash returns a hash of the value for used in sorting.

func (Time) String

func (t Time) String() string

String returns the string representation of this Time.

func (Time) Truth

func (t Time) Truth() skylark.Bool

Truth reports the python-truthiness of the value.

func (Time) Type

func (t Time) Type() string

Type returns the typename of the value.

Jump to

Keyboard shortcuts

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