pprocutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package pprocutils provides the functionality for Conduit to set up utilities for processors. DO NOT use this package directly.

Index

Constants

View Source
const (
	// ErrorCodeStart is the smallest error code which the wasm package can send.
	ErrorCodeStart = math.MaxUint32 - 100

	ErrorCodeNoMoreCommands = math.MaxUint32 - iota
	ErrorCodeUnknownCommandRequest
	ErrorCodeUnknownCommandResponse
	ErrorCodeMemoryOutOfRange
	ErrorCodeInternal

	ErrorCodeSubjectNotFound
	ErrorCodeVersionNotFound
	ErrorCodeInvalidSchema
)

Variables

View Source
var (
	ErrNoMoreCommands         = NewError(ErrorCodeNoMoreCommands, "no more commands")
	ErrUnknownCommandRequest  = NewError(ErrorCodeUnknownCommandRequest, "unknown command request")
	ErrUnknownCommandResponse = NewError(ErrorCodeUnknownCommandResponse, "unknown command response")
	ErrMemoryOutOfRange       = NewError(ErrorCodeMemoryOutOfRange, "memory out of range")

	ErrSubjectNotFound = NewError(ErrorCodeSubjectNotFound, "schema subject not found")
	ErrVersionNotFound = NewError(ErrorCodeVersionNotFound, "schema version not found")
	ErrInvalidSchema   = NewError(ErrorCodeInvalidSchema, "invalid schema")

	ErrInternal = NewError(ErrorCodeInternal, "internal error")
)
View Source
var Logger = zerolog.New(
	zerolog.NewConsoleWriter(
		func(w *zerolog.ConsoleWriter) {
			w.TimeFormat = "2006-01-02T15:04:05+00:00"
		},
	),
).With().
	Timestamp().
	Logger()

Logger is the logger for the processor. DO NOT use this logger directly, instead use the Logger() function in the root of the processor SDK.

Functions

This section is empty.

Types

type CreateSchemaRequest

type CreateSchemaRequest struct {
	Subject string
	Type    schema.Type
	Bytes   []byte
}

type CreateSchemaResponse

type CreateSchemaResponse struct {
	Schema schema.Schema
}

type Error

type Error struct {
	ErrCode uint32
	Message string
}

func NewError

func NewError(code uint32, message string) *Error

func NewErrorFromCode

func NewErrorFromCode(code uint32) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

type GetSchemaRequest

type GetSchemaRequest struct {
	Subject string
	Version int
}

type GetSchemaResponse

type GetSchemaResponse struct {
	Schema schema.Schema
}

type SchemaService

type SchemaService interface {
	CreateSchema(context.Context, CreateSchemaRequest) (CreateSchemaResponse, error)
	GetSchema(context.Context, GetSchemaRequest) (GetSchemaResponse, error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
v1

Jump to

Keyboard shortcuts

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