api

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package api implements common internal types across the Manifold API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Path added in v0.31.0

func Path(root, prefix string, dirs ...interface{}) string

Path returns a URL path with the correct prefix appended.

func Str2Bool

func Str2Bool(s string) (bool, error)

Str2Bool converts a string to a bool extending strconv.ParseBool to include "yes"/"no". It returns an error if the string is not a valid bool.

Types

type Time

type Time struct {
	time.Time
}

Time is a wrapper for time.Time that implements the text.Marshaler interface.

func Unix

func Unix(sec, nsec int64) Time

Unix returns the local Time corresponding to the given Unix time, sec seconds and nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999]. Not all sec values have a corresponding time value. One such value is 1<<63-1 (the largest int64 value).

func (Time) After

func (t Time) After(u Time) bool

After reports whether the time instant t is after u.

func (Time) Before

func (t Time) Before(u Time) bool

Before reports whether the time instant t is before u.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for t.

Jump to

Keyboard shortcuts

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