schemaregistry

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 44 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultInlineLimit = 64 << 10
	DefaultCacheBytes  = 32 << 20
	MaxSchemaBytes     = 1 << 20
	ModeReadWrite      = "READWRITE"
	ModeReadOnly       = "READONLY"
	ModeImport         = "IMPORT"
	CompatNone         = "NONE"
	CompatBackward     = "BACKWARD"
	CompatBackwardAll  = "BACKWARD_TRANSITIVE"
	CompatForward      = "FORWARD"
	CompatForwardAll   = "FORWARD_TRANSITIVE"
	CompatFull         = "FULL"
	CompatFullAll      = "FULL_TRANSITIVE"
)

Variables

This section is empty.

Functions

func ParseVersion

func ParseVersion(raw string) (int, error)

Types

type Config

type Config struct {
	Client      *clientv3.Client
	S3          storage.S3Client
	Namespace   string
	InlineLimit int
}

type Error

type Error struct {
	Status  int
	Code    int
	Message string
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

type Reference

type Reference struct {
	Name    string `json:"name"`
	Subject string `json:"subject"`
	Version int    `json:"version"`
}

type RegisterRequest

type RegisterRequest struct {
	Schema     string
	SchemaType string
	References []Reference
	ID         int64
	Version    int
	Normalize  bool
}

type Registry

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

func New

func New(cfg Config) (*Registry, error)

func (*Registry) CacheBytes

func (r *Registry) CacheBytes() int

func (*Registry) CacheResets

func (r *Registry) CacheResets() uint64

func (*Registry) CheckIDMarkers

func (r *Registry) CheckIDMarkers(ctx context.Context) error

func (*Registry) Compatibility

func (r *Registry) Compatibility(ctx context.Context, subject string, defaultToGlobal bool) (string, error)

func (*Registry) Compatible

func (r *Registry) Compatible(ctx context.Context, subject string, version int, req RegisterRequest) (bool, []string, error)

func (*Registry) Conflicts

func (r *Registry) Conflicts() uint64

func (*Registry) DeleteCompatibility

func (r *Registry) DeleteCompatibility(ctx context.Context, subject string) (string, error)

func (*Registry) DeleteMode

func (r *Registry) DeleteMode(ctx context.Context, subject string) (string, error)

func (*Registry) DeleteSubject

func (r *Registry) DeleteSubject(ctx context.Context, subject string, permanent bool) ([]int, error)

func (*Registry) DeleteVersion

func (r *Registry) DeleteVersion(ctx context.Context, subject string, version int, permanent bool) (int, error)

func (*Registry) IDVersions

func (r *Registry) IDVersions(ctx context.Context, id int64, deleted bool) ([]SubjectVersion, error)

func (*Registry) Init

func (r *Registry) Init(ctx context.Context) error

func (*Registry) Lookup

func (r *Registry) Lookup(ctx context.Context, subject string, req RegisterRequest, deleted bool) (*VersionedSchema, error)

func (*Registry) Mode

func (r *Registry) Mode(ctx context.Context, subject string, defaultToGlobal bool) (string, error)

func (*Registry) Ready

func (r *Registry) Ready(ctx context.Context) error

func (*Registry) ReferencedBy

func (r *Registry) ReferencedBy(ctx context.Context, subject string, version int) ([]int64, error)

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, subject string, req RegisterRequest) (*VersionedSchema, error)

func (*Registry) SchemaByGUID

func (r *Registry) SchemaByGUID(ctx context.Context, guid string) (*Schema, error)

func (*Registry) SchemaByID

func (r *Registry) SchemaByID(ctx context.Context, id int64) (*Schema, error)

func (*Registry) Schemas

func (r *Registry) Schemas(ctx context.Context, f SchemaFilter) ([]*VersionedSchema, error)

func (*Registry) SetCompatibility

func (r *Registry) SetCompatibility(ctx context.Context, subject, level string) error

func (*Registry) SetMode

func (r *Registry) SetMode(ctx context.Context, subject, mode string, force bool) error

func (*Registry) Subjects

func (r *Registry) Subjects(ctx context.Context, deleted bool) ([]string, error)

func (*Registry) Version

func (r *Registry) Version(ctx context.Context, subject string, version int, deleted bool) (*VersionedSchema, error)

func (*Registry) Versions

func (r *Registry) Versions(ctx context.Context, subject string, deleted bool) ([]int, error)

func (*Registry) Watch

func (r *Registry) Watch(ctx context.Context)

type Schema

type Schema struct {
	ID         int64
	Type       string
	Text       string
	References []Reference
	Hash       string
	Norm       string
	Desc       string
	FromDesc   bool
	// contains filtered or unexported fields
}

func (*Schema) GUID

func (s *Schema) GUID() string

type SchemaFilter

type SchemaFilter struct {
	SubjectPrefix string
	Deleted       bool
	LatestOnly    bool
	Offset        int
	Limit         int
}

type Server

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

func NewServer

func NewServer(reg *Registry, timeout time.Duration) *Server

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) SetDraining

func (s *Server) SetDraining()

type SubjectVersion

type SubjectVersion struct {
	Subject string `json:"subject"`
	Version int    `json:"version"`
}

type VersionedSchema

type VersionedSchema struct {
	Subject string
	Version int
	Schema  *Schema
	Deleted bool
}

Jump to

Keyboard shortcuts

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