schema

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package schema loads the protobuf descriptors used by ingress comparisons.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDescriptorSets added in v0.12.0

func LoadDescriptorSets(config Config) (*descriptorpb.FileDescriptorSet, error)

LoadDescriptorSets merges every .pb file in the configured directory into one set. The result is empty when no directory is configured.

func Merge added in v0.12.0

Merge combines descriptor sets, sorted by file name. A file may appear in several sets if the copies differ only in metadata; the first copy is kept.

Types

type Config added in v0.12.0

type Config struct {
	// DescriptorsDir holds binary FileDescriptorSet files, each including its imports.
	DescriptorsDir string `` /* 184-byte string literal not displayed */
}

Config selects static schema sources.

func NewConfig added in v0.12.0

func NewConfig() Config

NewConfig returns the default schema configuration.

type ReflectionLoader added in v0.5.0

type ReflectionLoader struct{}

ReflectionLoader loads service descriptors from a gRPC reflection endpoint.

func NewReflectionLoader added in v0.5.0

func NewReflectionLoader() *ReflectionLoader

NewReflectionLoader constructs a gRPC reflection descriptor loader.

func (*ReflectionLoader) Load added in v0.5.0

func (loader *ReflectionLoader) Load(ctx context.Context, endpoint string) (*descriptorpb.FileDescriptorSet, error)

Load returns the descriptor set exposed by the endpoint's application services.

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

Schema resolves messages and RPC methods from a local descriptor set.

func New

func New(data []byte) (*Schema, error)

New loads a binary FileDescriptorSet containing all of its imported files.

func NewFromFileDescriptorSet added in v0.7.0

func NewFromFileDescriptorSet(set *descriptorpb.FileDescriptorSet) (*Schema, error)

NewFromFileDescriptorSet loads a descriptor set containing all imported files.

func (*Schema) Message

Message resolves a fully qualified protobuf message name, including nested messages.

func (*Schema) Method

Method resolves a fully qualified RPC name such as example.users.v1.UserService.ListUsers.

func (*Schema) Types added in v0.7.0

func (s *Schema) Types() *dynamicpb.Types

Types returns the dynamic types resolved from this schema.

Jump to

Keyboard shortcuts

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