Categorygithub.com/skilld-labs/apicurio-registry-client-sdk-go

# Packages

No description provided by the author

# README

Apicurio Registry Client SDK for Go

Apicurio Registry is a datastore for standard event schemas and API designs. Apicurio Registry enables developers to manage and share the structure of their data using a REST interface. For example, client applications can dynamically push or pull the latest updates to or from the registry without needing to redeploy. Apicurio Registry also enables developers to create rules that govern how registry content can evolve over time. For example, this includes rules for content validation and version compatibility.

The Apicurio Registry REST API enables client applications to manage the artifacts in the registry. This API provides create, read, update, and delete operations for schema and API artifacts, rules, versions, and metadata.

The supported artifact types include:

  • Apache Avro schema
  • AsyncAPI specification
  • Google protocol buffers
  • GraphQL schema
  • JSON Schema
  • Kafka Connect schema
  • OpenAPI specification
  • Web Services Description Language
  • XML Schema Definition

Important: The Apicurio Registry REST API is available from https://MY-REGISTRY-URL/apis/registry/v2 by default. Therefore you must prefix all API operation paths with ../apis/registry/v2 in this case. For example: ../apis/registry/v2/ids/globalIds/{globalId}.

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.

Installation

Install the client SDK library to your Go project:

go get github.com/Apicurio/apicurio-registry-client-sdk-go

Add the following import to use it:

import "github.com/Apicurio/apicurio-registry-client-sdk-go"

To use a proxy, set the environment variable HTTP_PROXY:

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

Creating an API client

To create an API client using the default configuration options:

cfg := registryclient.NewConfiguration()
registryClient := registryclient.NewAPIClient(&cfg)

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(), registryclient.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(), registryclient.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(), registryclient.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), registryclient.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
AdminApiCreateGlobalRulePost /admin/rulesCreate global rule
AdminApiCreateRoleMappingPost /admin/roleMappingsCreate a new role mapping
AdminApiDeleteAllGlobalRulesDelete /admin/rulesDelete all global rules
AdminApiDeleteGlobalRuleDelete /admin/rules/{rule}Delete global rule
AdminApiDeleteRoleMappingDelete /admin/roleMappings/{principalId}Delete a role mapping
AdminApiExportDataGet /admin/exportExport registry data
AdminApiGetConfigPropertyGet /admin/config/properties/{propertyName}Get the value of a configuration property
AdminApiGetGlobalRuleConfigGet /admin/rules/{rule}Get global rule configuration
AdminApiGetLogConfigurationGet /admin/loggers/{logger}Get a single logger configuration
AdminApiGetRoleMappingGet /admin/roleMappings/{principalId}Return a single role mapping
AdminApiImportDataPost /admin/importImport registry data
AdminApiListConfigPropertiesGet /admin/config/propertiesList all configuration properties
AdminApiListGlobalRulesGet /admin/rulesList global rules
AdminApiListLogConfigurationsGet /admin/loggersList logging configurations
AdminApiListRoleMappingsGet /admin/roleMappingsList all role mappings
AdminApiRemoveLogConfigurationDelete /admin/loggers/{logger}Removes logger configuration
AdminApiResetConfigPropertyDelete /admin/config/properties/{propertyName}Reset a configuration property
AdminApiSetLogConfigurationPut /admin/loggers/{logger}Set a logger's configuration
AdminApiUpdateConfigPropertyPut /admin/config/properties/{propertyName}Update a configuration property
AdminApiUpdateGlobalRuleConfigPut /admin/rules/{rule}Update global rule configuration
AdminApiUpdateRoleMappingPut /admin/roleMappings/{principalId}Update a role mapping
ArtifactRulesApiCreateArtifactRulePost /groups/{groupId}/artifacts/{artifactId}/rulesCreate artifact rule
ArtifactRulesApiDeleteArtifactRuleDelete /groups/{groupId}/artifacts/{artifactId}/rules/{rule}Delete artifact rule
ArtifactRulesApiDeleteArtifactRulesDelete /groups/{groupId}/artifacts/{artifactId}/rulesDelete artifact rules
ArtifactRulesApiGetArtifactRuleConfigGet /groups/{groupId}/artifacts/{artifactId}/rules/{rule}Get artifact rule configuration
ArtifactRulesApiListArtifactRulesGet /groups/{groupId}/artifacts/{artifactId}/rulesList artifact rules
ArtifactRulesApiTestUpdateArtifactPut /groups/{groupId}/artifacts/{artifactId}/testTest update artifact
ArtifactRulesApiUpdateArtifactRuleConfigPut /groups/{groupId}/artifacts/{artifactId}/rules/{rule}Update artifact rule configuration
ArtifactsApiCreateArtifactPost /groups/{groupId}/artifactsCreate artifact
ArtifactsApiDeleteArtifactDelete /groups/{groupId}/artifacts/{artifactId}Delete artifact
ArtifactsApiDeleteArtifactsInGroupDelete /groups/{groupId}/artifactsDeletes all artifacts in a group
ArtifactsApiGetContentByGlobalIdGet /ids/globalIds/{globalId}Get artifact by global ID
ArtifactsApiGetContentByHashGet /ids/contentHashes/{contentHash}/Get artifact content by SHA-256 hash
ArtifactsApiGetContentByIdGet /ids/contentIds/{contentId}/Get artifact content by ID
ArtifactsApiGetLatestArtifactGet /groups/{groupId}/artifacts/{artifactId}Get latest artifact
ArtifactsApiListArtifactsInGroupGet /groups/{groupId}/artifactsList artifacts in group
ArtifactsApiReferencesByContentHashGet /ids/contentHashes/{contentHash}/referencesReturns a list with all the references for the artifact with the given hash
ArtifactsApiReferencesByContentIdGet /ids/contentIds/{contentId}/referencesReturns a list with all the references for the artifact with the given content id.
ArtifactsApiReferencesByGlobalIdGet /ids/globalIds/{globalId}/referencesReturns a list with all the references for the artifact with the given global id.
ArtifactsApiSearchArtifactsGet /search/artifactsSearch for artifacts
ArtifactsApiSearchArtifactsByContentPost /search/artifactsSearch for artifacts by content
ArtifactsApiUpdateArtifactPut /groups/{groupId}/artifacts/{artifactId}Update artifact
ArtifactsApiUpdateArtifactStatePut /groups/{groupId}/artifacts/{artifactId}/stateUpdate artifact state
MetadataApiDeleteArtifactVersionMetaDataDelete /groups/{groupId}/artifacts/{artifactId}/versions/{version}/metaDelete artifact version metadata
MetadataApiGetArtifactMetaDataGet /groups/{groupId}/artifacts/{artifactId}/metaGet artifact metadata
MetadataApiGetArtifactVersionMetaDataGet /groups/{groupId}/artifacts/{artifactId}/versions/{version}/metaGet artifact version metadata
MetadataApiGetArtifactVersionMetaDataByContentPost /groups/{groupId}/artifacts/{artifactId}/metaGet artifact version metadata by content
MetadataApiUpdateArtifactMetaDataPut /groups/{groupId}/artifacts/{artifactId}/metaUpdate artifact metadata
MetadataApiUpdateArtifactVersionMetaDataPut /groups/{groupId}/artifacts/{artifactId}/versions/{version}/metaUpdate artifact version metadata
SystemApiGetResourceLimitsGet /system/limitsGet resource limits information
SystemApiGetSystemInfoGet /system/infoGet system information
UsersApiGetCurrentUserInfoGet /users/meGet current user
VersionsApiCreateArtifactVersionPost /groups/{groupId}/artifacts/{artifactId}/versionsCreate artifact version
VersionsApiGetArtifactVersionGet /groups/{groupId}/artifacts/{artifactId}/versions/{version}Get artifact version
VersionsApiGetArtifactVersionReferencesGet /groups/{groupId}/artifacts/{artifactId}/versions/{version}/referencesGet artifact version
VersionsApiListArtifactVersionsGet /groups/{groupId}/artifacts/{artifactId}/versionsList artifact versions
VersionsApiUpdateArtifactVersionStatePut /groups/{groupId}/artifacts/{artifactId}/versions/{version}/stateUpdate artifact version state

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

[email protected]