schemaregistry

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotFound = "schema not found"

	ErrNotCompatible        = "schema not compatible"
	ErrInvalidCompatibility = "invalid compatibility level"
)

Errors for schemaregistry

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(content []byte, name string, path string) (string, error)

CreateFile creates a file at a given location with the supplied content

func RemoveFile

func RemoveFile(path string) error

RemoveFile removes a file at a given location

Types

type Client

type Client struct {
	Config Config
}

Client is a struct for schemaregistry client

func (*Client) SchemaCreate

func (c *Client) SchemaCreate(subject string, schema string, schemaType string, environment string) (string, error)

SchemaCreate creates a schema in the schemaregistry

func (*Client) SchemaDelete

func (c *Client) SchemaDelete(subject string, version string, permanent bool, environment string) (string, error)

SchemaDelete deletes a schema in the schemaregistry

func (*Client) SchemaDescribe

func (c *Client) SchemaDescribe(subject string, version string, environment string) (SchemaDescribeResponse, error)

SchemaDescribe gets a schema in the schemaregistry

func (*Client) SchemaSubjectUpdateCommand

func (c *Client) SchemaSubjectUpdateCommand(subject string, compatibility string, environment string) (string, error)

SchemaSubjectUpdateCommand Executes Confluent CLI command to update a Schema in Confluent Cloud

type Config

type Config struct {
	APICredentials clients.APICredentials
	SchemaPath     string
}

Config is a configuration element for the schema registry client

type IClient

type IClient interface {
	SchemaCreate(subject string, schema string, schemaType string, environment string) (string, error)
	SchemaDelete(subject string, version string, permanent bool, environment string) (string, error)
	SchemaDescribe(subject string, version string, environment string) (SchemaDescribeResponse, error)
	SchemaSubjectUpdateCommand(subject string, compatibility string, environment string) (string, error)
}

IClient interface for schemaregistry client

func NewClient

func NewClient(c Config) IClient

NewClient is a factory method for schemaregistry client

type SchemaDescribeResponse

type SchemaDescribeResponse struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	Doc       string `json:"doc"`
	Fields    []struct {
		Name string `json:"name"`
		Type string `json:"type"`
		Doc  string `json:"doc"`
	} `json:"fields"`
}

SchemaDescribeResponse is a struct for a response from the schemaregistry in confluent cloud

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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