Categorygithub.com/confluentinc/schema-registry-sdk-go
repositorypackage
0.1.0
Repository: https://github.com/confluentinc/schema-registry-sdk-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go API client for schemaregistry

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import sw "./schemaregistry"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
DefaultApiAsyncapiParsePutPut /asyncapi/parse
DefaultApiAsyncapiPutPut /asyncapi
DefaultApiCreateBusinessMetadataPost /catalog/v1/entity/businessmetadataBulk API to create multiple business metadata.
DefaultApiCreateBusinessMetadataDefsPost /catalog/v1/types/businessmetadatadefsBulk create API for business metadata definitions.
DefaultApiCreateDekPost /dek-registry/v1/keks/{name}/deksCreate a dek.
DefaultApiCreateExporterPost /exportersCreate an exporter.
DefaultApiCreateKekPost /dek-registry/v1/keksCreate a kek.
DefaultApiCreateOrUpdatePost /catalog/v1/entity
DefaultApiCreateTagDefsPost /catalog/v1/types/tagdefsBulk create API for tag definitions.
DefaultApiCreateTagsPost /catalog/v1/entity/tagsBulk API to create multiple tags.
DefaultApiDeleteBusinessMetadataDelete /catalog/v1/entity/type/{typeName}/name/{qualifiedName}/businessmetadata/{bmName}Delete a business metadata on an entity.
DefaultApiDeleteBusinessMetadataDefDelete /catalog/v1/types/businessmetadatadefs/{bmName}Delete API for business metadata definition identified by its name.
DefaultApiDeleteByUniqueAttributesDelete /catalog/v1/entity/type/{typeName}/name/{qualifiedName}
DefaultApiDeleteDekVersionDelete /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}Delete a dek version.
DefaultApiDeleteDekVersionsDelete /dek-registry/v1/keks/{name}/deks/{subject}Delete all versions of a dek.
DefaultApiDeleteExporterDelete /exporters/{name}Delete an exporter.
DefaultApiDeleteKekDelete /dek-registry/v1/keks/{name}Delete a kek.
DefaultApiDeleteSchemaVersionDelete /subjects/{subject}/versions/{version}Deletes a specific version of the schema registered under this subject. This only deletes the version and the schema ID remains intact making it still possible to decode data using the schema ID. This API is recommended to be used only in development environments or under extreme circumstances where-in, its required to delete a previously registered schema for compatibility purposes or re-register previously registered schema.
DefaultApiDeleteSubjectDelete /subjects/{subject}Deletes the specified subject and its associated compatibility level if registered. It is recommended to use this API only when a topic needs to be recycled or in development environment.
DefaultApiDeleteSubjectConfigDelete /config/{subject}Deletes the specified subject-level compatibility level config and revert to the global default.
DefaultApiDeleteSubjectModeDelete /mode/{subject}Deletes the specified subject-level mode and revert to the global default.
DefaultApiDeleteTagDelete /catalog/v1/entity/type/{typeName}/name/{qualifiedName}/tags/{tagName}Delete a tag on an entity.
DefaultApiDeleteTagDefDelete /catalog/v1/types/tagdefs/{tagName}Delete API for tag definition identified by its name.
DefaultApiDeleteTopLevelConfigDelete /configDelete global compatibility level
DefaultApiGetGet /Schema Registry Root Resource
DefaultApiGetAllBusinessMetadataDefsGet /catalog/v1/types/businessmetadatadefsBulk retrieval API for retrieving business metadata definitions.
DefaultApiGetAllTagDefsGet /catalog/v1/types/tagdefsBulk retrieval API for retrieving tag definitions.
DefaultApiGetBusinessMetadataGet /catalog/v1/entity/type/{typeName}/name/{qualifiedName}/businessmetadataGets the list of business metadata for a given entity represented by a qualified name.
DefaultApiGetBusinessMetadataDefByNameGet /catalog/v1/types/businessmetadatadefs/{bmName}Get the business metadata definition with the given name.
DefaultApiGetByUniqueAttributesGet /catalog/v1/entity/type/{typeName}/name/{qualifiedName}Fetch complete definition of an entity given its type and unique attribute.
DefaultApiGetClusterIdGet /v1/metadata/idGet the server metadata
DefaultApiGetDekGet /dek-registry/v1/keks/{name}/deks/{subject}Get a dek by subject.
DefaultApiGetDekByVersionGet /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}Get a dek by subject and version.
DefaultApiGetDekSubjectsGet /dek-registry/v1/keks/{name}/deksGet a list of dek subjects.
DefaultApiGetDekVersionsGet /dek-registry/v1/keks/{name}/deks/{subject}/versionsList versions of dek.
DefaultApiGetExporterConfigGet /exporters/{name}/configGet the config for an exporter.
DefaultApiGetExporterInfoGet /exporters/{name}Get the info for an exporter.
DefaultApiGetExporterStatusGet /exporters/{name}/statusGet the status for an exporter.
DefaultApiGetExportersGet /exportersGet a list of exporter names.
DefaultApiGetKekGet /dek-registry/v1/keks/{name}Get a kek by name.
DefaultApiGetKekNamesGet /dek-registry/v1/keksGet a list of kek names.
DefaultApiGetModeGet /mode/{subject}Get mode for a subject.
DefaultApiGetReferencedByGet /subjects/{subject}/versions/{version}/referencedbyGet the schemas that reference the specified schema.
DefaultApiGetSchemaGet /schemas/ids/{id}Get the schema string identified by the input ID.
DefaultApiGetSchemaByVersionGet /subjects/{subject}/versions/{version}Get a specific version of the schema registered under this subject.
DefaultApiGetSchemaOnlyGet /subjects/{subject}/versions/{version}/schemaGet the schema for the specified version of this subject. The unescaped schema only is returned.
DefaultApiGetSchemaTypesGet /schemas/typesGet the schema types supported by this registry.
DefaultApiGetSchemasGet /schemasGet the schemas.
DefaultApiGetSubjectLevelConfigGet /config/{subject}Get compatibility level for a subject.
DefaultApiGetSubjectsGet /schemas/ids/{id}/subjectsGet all the subjects associated with the input ID.
DefaultApiGetTagDefByNameGet /catalog/v1/types/tagdefs/{tagName}Get the tag definition with the given name.
DefaultApiGetTagsGet /catalog/v1/entity/type/{typeName}/name/{qualifiedName}/tagsGets the list of classifications for a given entity represented by a qualifed name.
DefaultApiGetTopLevelConfigGet /configGet global compatibility level
DefaultApiGetTopLevelModeGet /modeGet global mode.
DefaultApiGetVersionsGet /schemas/ids/{id}/versionsGet all the subject-version pairs associated with the input ID.
DefaultApiListGet /subjectsGet a list of registered subjects.
DefaultApiListContextsGet /contextsGet a list of contexts.
DefaultApiListVersionsGet /subjects/{subject}/versionsGet a list of versions registered under the specified subject.
DefaultApiLookUpSchemaUnderSubjectPost /subjects/{subject}Check if a schema has already been registered under the specified subject. If so, this returns the schema string along with its globally unique identifier, its version under this subject and the subject name.
DefaultApiPartialUpdateByUniqueAttributesPut /catalog/v1/entity
DefaultApiPauseExporterPut /exporters/{name}/pausePause an exporter.
DefaultApiPostPost /
DefaultApiPutExporterPut /exporters/{name}Alters an exporter.
DefaultApiPutExporterConfigPut /exporters/{name}/configAlters the config of an exporter.
DefaultApiPutKekPut /dek-registry/v1/keks/{name}Alters a kek.
DefaultApiRegisterPost /subjects/{subject}/versionsRegister schema under a subject
DefaultApiResetExporterPut /exporters/{name}/resetReset an exporter.
DefaultApiResumeExporterPut /exporters/{name}/resumeResume an exporter.
DefaultApiSearchUsingAttributeGet /catalog/v1/search/attributeRetrieve data for the specified attribute search query.
DefaultApiSearchUsingBasicGet /catalog/v1/search/basicRetrieve data for the specified fulltext query.
DefaultApiTestCompatibilityBySubjectNamePost /compatibility/subjects/{subject}/versions/{version}Test input schema against a particular version of a subject's schema for compatibility.
DefaultApiTestCompatibilityForSubjectPost /compatibility/subjects/{subject}/versionsTest input schema against a subject's schemas for compatibility, based on the compatibility level of the subject configured. In other word, it will perform the same compatibility check as register for that subject
DefaultApiUndeleteDekVersionPost /dek-registry/v1/keks/{name}/deks/{subject}/versions/{version}/undeleteUndelete a dek version.
DefaultApiUndeleteDekVersionsPost /dek-registry/v1/keks/{name}/deks/{subject}/undeleteUndelete all versions of a dek.
DefaultApiUndeleteKekPost /dek-registry/v1/keks/{name}/undeleteUndelete a kek.
DefaultApiUpdateBusinessMetadataPut /catalog/v1/entity/businessmetadataBulk API to update multiple business metadata.
DefaultApiUpdateBusinessMetadataDefsPut /catalog/v1/types/businessmetadatadefsBulk update API for business metadata definitions.
DefaultApiUpdateModePut /mode/{subject}Update mode for the specified subject.
DefaultApiUpdateSubjectLevelConfigPut /config/{subject}Update compatibility level for the specified subject.
DefaultApiUpdateTagDefsPut /catalog/v1/types/tagdefsBulk update API for tag definitions.
DefaultApiUpdateTagsPut /catalog/v1/entity/tagsBulk API to update multiple tags.
DefaultApiUpdateTopLevelConfigPut /configUpdate global compatibility level
DefaultApiUpdateTopLevelModePut /modeUpdate global mode.

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author