types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: MIT Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stringify

func Stringify(message interface{}) string

Stringify attempts to create a reasonable string representation of types in the GitHub library. It does things like resolve pointers to their values and omits struct fields with nil values.

Types

type BooleanValue

type BooleanValue *bool

A BooleanValue is a boolean which may or may not be present.

func Boolean

func Boolean(v bool) BooleanValue

Boolean converts a Go bool into a BooleanValue.

func False

func False() BooleanValue

False is the BooleanValue equivalent of the Go literal false.

func True

func True() BooleanValue

True is the BooleanValue equivalent of the Go literal true.

type DoubleValue

type DoubleValue *float64

A DoubleValue is a 64-bit floating point number which may or may not be present.

func Double

func Double(v float64) DoubleValue

Double converts a Go float64 into a DoubleValue.

type FloatValue

type FloatValue *float32

A FloatValue is a 32-bit floating point number which may or may not be present.

func Float

func Float(v float32) FloatValue

Float converts a Go float32 into a FloatValue.

type IntegerValue

type IntegerValue *int

An IntegerValue is an integer which may or may not be present.

func Integer

func Integer(v int) IntegerValue

Integer converts a Go int into an IntegerValue.

type LongValue

type LongValue *int64

A LongValue is a 64-bit integer which may or may not be present.

func Long

func Long(v int64) LongValue

Long converts a Go int64 into a LongValue.

type StringValue

type StringValue *string

A StringValue is a string which may or may not be present.

func String

func String(v string) StringValue

String converts a Go string into a StringValue.

type Stringable

type Stringable interface {
	String() string
}

type Timestamp

type Timestamp struct {
	time.Time
}

Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. This is necessary for some fields since the GitHub API is inconsistent in how it represents times. All exported methods of time.Time can be called on Timestamp.

func (Timestamp) Equal

func (t Timestamp) Equal(u Timestamp) bool

Equal reports whether t and u are equal based on time.Equal

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.

Jump to

Keyboard shortcuts

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