protoiface

package
v2.0.0-...-d24bc72 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package protoiface contains types referenced by generated messages.

WARNING: This package should only ever be imported by generated messages. The compatibility agreement covers nothing except for functionality needed to keep existing generated messages operational.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionDescV1

type ExtensionDescV1 struct {
	// Type is the descriptor type for the extension field using the v2 API.
	// If populated, the information in this field takes precedence over
	// all other fields in ExtensionDescV1.
	Type protoreflect.ExtensionType

	// ExtendedType is a typed nil-pointer to the parent message type that
	// is being extended. It is possible for this to be unpopulated in v2
	// since the message may no longer implement the MessageV1 interface.
	//
	// Deprecated: Use Type.ExtendedType instead.
	ExtendedType MessageV1

	// ExtensionType is zero value of the extension type.
	//
	// For historical reasons, reflect.TypeOf(ExtensionType) and Type.GoType
	// may not be identical:
	//	* for scalars (except []byte), where ExtensionType uses *T,
	//	while Type.GoType uses T.
	//	* for repeated fields, where ExtensionType uses []T,
	//	while Type.GoType uses *[]T.
	//
	// Deprecated: Use Type.GoType instead.
	ExtensionType interface{}

	// Field is the field number of the extension.
	//
	// Deprecated: Use Type.Number instead.
	Field int32

	// Name is the fully qualified name of extension.
	//
	// Deprecated: Use Type.FullName instead.
	Name string

	// Tag is the protobuf struct tag used in the v1 API.
	//
	// Deprecated: Do not use.
	Tag string

	// Filename is the proto filename in which the extension is defined.
	//
	// Deprecated: Use Type.Parent to ascend to the top-most parent and use
	// protoreflect.FileDescriptor.Path.
	Filename string
}

type ExtensionRangeV1

type ExtensionRangeV1 struct {
	Start, End int32 // both inclusive
}

type MarshalOptions

type MarshalOptions struct {
	AllowPartial  bool
	Deterministic bool
	UseCachedSize bool

	pragma.NoUnkeyedLiterals
}

MarshalOptions configure the marshaler.

This type is identical to the one in package proto.

type MessageV1

type MessageV1 interface {
	Reset()
	String() string
	ProtoMessage()
}

type MethodFlag

type MethodFlag int64

MethodFlag indicates support for optional fast-path features.

const (
	// MethodFlagDeterministicMarshal indicates support for deterministic marshaling.
	MethodFlagDeterministicMarshal MethodFlag = 1 << iota
)

type Methoder

type Methoder interface {
	XXX_Methods() *Methods // may return nil
}

Methoder is an optional interface implemented by generated messages to provide fast-path implementations of various operations.

type Methods

type Methods struct {
	// Flags indicate support for optional features.
	Flags MethodFlag

	// MarshalAppend appends the wire-format encoding of m to b, returning the result.
	// It does not perform required field checks.
	MarshalAppend func(b []byte, m protoreflect.ProtoMessage, opts MarshalOptions) ([]byte, error)

	// Size returns the size in bytes of the wire-format encoding of m.
	Size func(m protoreflect.ProtoMessage) int

	// Unmarshal parses the wire-format message in b and places the result in m.
	// It does not reset m or perform required field checks.
	Unmarshal func(b []byte, m protoreflect.ProtoMessage, opts UnmarshalOptions) error

	// IsInitialized returns an error if any required fields in m are not set.
	IsInitialized func(m protoreflect.ProtoMessage) error

	pragma.NoUnkeyedLiterals
}

Methods is a set of optional fast-path implementations of various operations.

type UnmarshalOptions

type UnmarshalOptions struct {
	AllowPartial   bool
	DiscardUnknown bool

	pragma.NoUnkeyedLiterals
}

UnmarshalOptions configures the unmarshaler.

This type is identical to the one in package proto.

Jump to

Keyboard shortcuts

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