protooptions

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package protooptions contains low-level parsers for Aisphere protobuf custom options.

The cmd generators intentionally parse unknown option payloads by extension number so they do not depend on already-generated Go code for the options protos during bootstrapping.

Index

Constants

View Source
const (
	// google.api.http = 72295728, see google/api/annotations.proto.
	ExtGoogleHTTP protowire.Number = 72295728

	// aisphere.options.v1 method extensions, see api/aisphere/options/v1/authz.proto.
	ExtAuthz      protowire.Number = 51001
	ExtAudit      protowire.Number = 51002
	ExtCapability protowire.Number = 51003

	// aisphere.access.v1.policy, see api/aisphere/access/v1/access.proto.
	ExtAccess protowire.Number = 51010
)
View Source
const (
	GatewayPublishUnspecified int32 = 0
	GatewayPublishEnabled     int32 = 1
	GatewayPublishDisabled    int32 = 2
)

Variables

This section is empty.

Functions

func FindExtensionPayloads

func FindExtensionPayloads(b []byte, ext protowire.Number) [][]byte

func HasExtension

func HasExtension(b []byte, ext protowire.Number) bool

func LastExtensionPayload

func LastExtensionPayload(b []byte, ext protowire.Number) ([]byte, bool)

func MethodUnknown

func MethodUnknown(m *descriptorpb.MethodDescriptorProto) []byte

Types

type AccessAudit added in v0.1.16

type AccessAudit struct {
	Enabled bool
	Event   string
	Risk    string
}

func ParseAccessAudit added in v0.1.16

func ParseAccessAudit(b []byte) AccessAudit

type AccessBreaker added in v0.1.16

type AccessBreaker struct {
	Enabled bool
	Name    string
}

func ParseAccessBreaker added in v0.1.16

func ParseAccessBreaker(b []byte) AccessBreaker

type AccessGateway added in v0.2.2

type AccessGateway struct {
	Publish  int32
	Profiles []string
	Tags     []string
}

func ParseAccessGateway added in v0.2.2

func ParseAccessGateway(b []byte) AccessGateway

type AccessPolicy added in v0.1.16

type AccessPolicy struct {
	Exposure  int32
	Authz     AuthzRule
	Audit     AccessAudit
	RateLimit AccessRateLimit
	Breaker   AccessBreaker
	Reason    string
	Gateway   AccessGateway
}

AccessPolicy is a low-level representation of aisphere.access.v1.AccessPolicy. The parser keeps cmd tools independent from generated option code.

func ParseAccessPolicy added in v0.1.16

func ParseAccessPolicy(b []byte) AccessPolicy

type AccessRateLimit added in v0.1.16

type AccessRateLimit struct {
	Enabled bool
	Key     string
	QPS     float64
	Burst   int32
	Backend int32
	Scope   int32
}

func ParseAccessRateLimit added in v0.1.16

func ParseAccessRateLimit(b []byte) AccessRateLimit

type AuditRule

type AuditRule struct {
	Event string
	Risk  string
}

func ParseAudit

func ParseAudit(b []byte) AuditRule

type AuthzRule

type AuthzRule struct {
	Action   string
	Resource string
	Audience string
	Mode     int32
}

func ParseAccessAuthz added in v0.1.16

func ParseAccessAuthz(b []byte) AuthzRule

func ParseAuthz

func ParseAuthz(b []byte) AuthzRule

type CapabilityRule

type CapabilityRule struct {
	Name  string
	Group string
}

func ParseCapability

func ParseCapability(b []byte) CapabilityRule

Jump to

Keyboard shortcuts

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