pbtypes

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2018 License: Apache-2.0 Imports: 7 Imported by: 69

README

pbtypes

protobuf helper types

Documentation

Overview

Package pbtypes contains protocol buffer types (Timestamp, Void, etc.) and related helpers.

Package pbtypes is a generated protocol buffer package.

It is generated from these files:
	timestamp.proto
	void.proto
	html.proto

It has these top-level messages:
	Timestamp
	Void
	HTML

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthHtml = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHtml   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthTimestamp = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTimestamp   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthVoid = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowVoid   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type HTML

type HTML struct {
	HTML string `protobuf:"bytes,1,opt,name=HTML,proto3" json:"__html"`
}

HTML is a type which marshals into {__html: "html code here"} to designate that this value is sanitized HTML code, see https://facebook.github.io/react/tips/dangerously-set-inner-html.html

func (*HTML) Marshal

func (m *HTML) Marshal() (data []byte, err error)

func (*HTML) MarshalTo

func (m *HTML) MarshalTo(data []byte) (int, error)

func (*HTML) ProtoMessage

func (*HTML) ProtoMessage()

func (*HTML) Reset

func (m *HTML) Reset()

func (*HTML) Size

func (m *HTML) Size() (n int)

func (*HTML) String

func (m *HTML) String() string

func (*HTML) Unmarshal

func (m *HTML) Unmarshal(data []byte) error

type RawMessage

type RawMessage []byte

RawMessage is a raw encoded JSON object. It implements json.Marshaler and json.Unmarshaler like json.RawMessage, but also proto.Marshaler and proto.Unmarshaler.

func (*RawMessage) Marshal

func (m *RawMessage) Marshal() ([]byte, error)

Marshal implements proto.Marshaler.

func (*RawMessage) MarshalJSON

func (m *RawMessage) MarshalJSON() ([]byte, error)

MarshalJSON returns *m as the JSON encoding of m.

func (*RawMessage) Unmarshal

func (m *RawMessage) Unmarshal(data []byte) error

Unmarshal implements proto.Unmarshaler.

func (*RawMessage) UnmarshalJSON

func (m *RawMessage) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *m to a copy of data.

type Timestamp

type Timestamp struct {
	// Represents seconds of UTC time since Unix epoch
	// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
	// 9999-12-31T23:59:59Z inclusive.
	Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	// Non-negative fractions of a second at nanosecond resolution. Negative
	// second values with fractions must still have non-negative nanos values
	// that count forward in time. Must be from 0 to 999,999,999
	// inclusive.
	Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
}

func NewTimestamp

func NewTimestamp(t time.Time) Timestamp

NewTimestamp creates a new Timestamp from a time.Time.

func (*Timestamp) Marshal

func (m *Timestamp) Marshal() (data []byte, err error)

func (Timestamp) MarshalJSON

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

func (*Timestamp) MarshalTo

func (m *Timestamp) MarshalTo(data []byte) (int, error)

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset

func (m *Timestamp) Reset()

func (*Timestamp) Size

func (m *Timestamp) Size() (n int)

func (*Timestamp) String

func (m *Timestamp) String() string

func (Timestamp) Time

func (t Timestamp) Time() time.Time

func (*Timestamp) Unmarshal

func (m *Timestamp) Unmarshal(data []byte) error

func (*Timestamp) UnmarshalJSON

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

type Void

type Void struct {
}

Void is an empty type used as the protobuf RPC method arg or result for methods that take no parameters or yield no results, respectively.

func (*Void) Marshal

func (m *Void) Marshal() (data []byte, err error)

func (*Void) MarshalTo

func (m *Void) MarshalTo(data []byte) (int, error)

func (*Void) ProtoMessage

func (*Void) ProtoMessage()

func (*Void) Reset

func (m *Void) Reset()

func (*Void) Size

func (m *Void) Size() (n int)

func (*Void) String

func (m *Void) String() string

func (*Void) Unmarshal

func (m *Void) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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