<!-- Code generated by gomarkdoc. DO NOT EDIT -->

```go
import "github.com/Azure/iot-operations-sdks/go/services/schemaregistry"
```

## Index

- [Constants](<#constants>)
- [type Client](<#Client>)
  - [func New\(app \*protocol.Application, client protocol.MqttClient, opt ...ClientOption\) \(\*Client, error\)](<#New>)
  - [func \(c \*Client\) Close\(\)](<#Client.Close>)
  - [func \(c \*Client\) Get\(ctx context.Context, name string, opt ...GetOption\) \(\*Schema, error\)](<#Client.Get>)
  - [func \(c \*Client\) Put\(ctx context.Context, content string, format Format, opt ...PutOption\) \(\*Schema, error\)](<#Client.Put>)
  - [func \(c \*Client\) Start\(ctx context.Context\) error](<#Client.Start>)
- [type ClientOption](<#ClientOption>)
  - [func WithLogger\(logger \*slog.Logger\) ClientOption](<#WithLogger>)
- [type ClientOptions](<#ClientOptions>)
  - [func \(o \*ClientOptions\) Apply\(opts \[\]ClientOption, rest ...ClientOption\)](<#ClientOptions.Apply>)
- [type Error](<#Error>)
- [type ErrorCode](<#ErrorCode>)
- [type ErrorDetails](<#ErrorDetails>)
- [type ErrorTarget](<#ErrorTarget>)
- [type Format](<#Format>)
- [type GetOption](<#GetOption>)
- [type GetOptions](<#GetOptions>)
  - [func \(o \*GetOptions\) Apply\(opts \[\]GetOption, rest ...GetOption\)](<#GetOptions.Apply>)
- [type PutOption](<#PutOption>)
- [type PutOptions](<#PutOptions>)
  - [func \(o \*PutOptions\) Apply\(opts \[\]PutOption, rest ...PutOption\)](<#PutOptions.Apply>)
- [type Schema](<#Schema>)
- [type SchemaType](<#SchemaType>)
- [type WithSchemaType](<#WithSchemaType>)
- [type WithTags](<#WithTags>)
- [type WithTimeout](<#WithTimeout>)
- [type WithVersion](<#WithVersion>)


## Constants

<a name="Delta1"></a>

```go
const (
    Delta1            = schemaregistry.FormatDelta1
    JSONSchemaDraft07 = schemaregistry.FormatJsonSchemaDraft07
)
```

<a name="ErrorCodeBadRequest"></a>

```go
const (
    ErrorCodeBadRequest    = schemaregistry.SchemaRegistryErrorCodeBadRequest
    ErrorCodeInternalError = schemaregistry.SchemaRegistryErrorCodeInternalError
    ErrorCodeNotFound      = schemaregistry.SchemaRegistryErrorCodeNotFound
)
```

<a name="ErrorTargetDescriptionProperty"></a>

```go
const (
    ErrorTargetDescriptionProperty       = schemaregistry.SchemaRegistryErrorTargetDescriptionProperty
    ErrorTargetDisplayNameProperty       = schemaregistry.SchemaRegistryErrorTargetDisplayNameProperty
    ErrorTargetFormatProperty            = schemaregistry.SchemaRegistryErrorTargetFormatProperty
    ErrorTargetNameProperty              = schemaregistry.SchemaRegistryErrorTargetNameProperty
    ErrorTargetSchemaArmResource         = schemaregistry.SchemaRegistryErrorTargetSchemaArmResource
    ErrorTargetSchemaContentProperty     = schemaregistry.SchemaRegistryErrorTargetSchemaContentProperty
    ErrorTargetSchemaRegistryArmResource = schemaregistry.SchemaRegistryErrorTargetSchemaRegistryArmResource
    ErrorTargetSchemaTypeProperty        = schemaregistry.SchemaRegistryErrorTargetSchemaTypeProperty
    ErrorTargetSchemaVersionArmResource  = schemaregistry.SchemaRegistryErrorTargetSchemaVersionArmResource
    ErrorTargetTagsProperty              = schemaregistry.SchemaRegistryErrorTargetTagsProperty
    ErrorTargetVersionProperty           = schemaregistry.SchemaRegistryErrorTargetVersionProperty
)
```

<a name="MessageSchema"></a>

```go
const (
    MessageSchema = schemaregistry.SchemaTypeMessageSchema
)
```

<a name="Client"></a>
## type [Client](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L16-L18>)

Client represents a client of the schema registry.

```go
type Client struct {
    // contains filtered or unexported fields
}
```

<a name="New"></a>
### func [New](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L30-L34>)

```go
func New(app *protocol.Application, client protocol.MqttClient, opt ...ClientOption) (*Client, error)
```

New creates a new schema registry client.

<a name="Client.Close"></a>
### func \(\*Client\) [Close](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L55>)

```go
func (c *Client) Close()
```

Close all underlying MQTT topics and free resources.

<a name="Client.Get"></a>
### func \(\*Client\) [Get](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/get.go#L26-L30>)

```go
func (c *Client) Get(ctx context.Context, name string, opt ...GetOption) (*Schema, error)
```

Get retrieves schema information from the schema registry.

<a name="Client.Put"></a>
### func \(\*Client\) [Put](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/put.go#L29-L34>)

```go
func (c *Client) Put(ctx context.Context, content string, format Format, opt ...PutOption) (*Schema, error)
```

Put adds or updates a schema in the schema registry.

<a name="Client.Start"></a>
### func \(\*Client\) [Start](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L50>)

```go
func (c *Client) Start(ctx context.Context) error
```

Start listening to all underlying MQTT topics.

<a name="ClientOption"></a>
## type [ClientOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L21>)

ClientOption represents a single option for the client.

```go
type ClientOption interface {
    // contains filtered or unexported methods
}
```

<a name="WithLogger"></a>
### func [WithLogger](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/options.go#L30>)

```go
func WithLogger(logger *slog.Logger) ClientOption
```

WithLogger enables logging with the provided slog logger.

<a name="ClientOptions"></a>
## type [ClientOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L24-L26>)

ClientOptions are the resolved options for the client.

```go
type ClientOptions struct {
    Logger *slog.Logger
}
```

<a name="ClientOptions.Apply"></a>
### func \(\*ClientOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/client.go#L60-L63>)

```go
func (o *ClientOptions) Apply(opts []ClientOption, rest ...ClientOption)
```

Apply resolves the provided list of options.

<a name="Error"></a>
## type [Error](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L27>)

Error object for schema operations.

```go
type Error = schemaregistry.SchemaRegistryError
```

<a name="ErrorCode"></a>
## type [ErrorCode](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L30>)

ErrorCode for classification of errors \(ex: '400', '404', '500', etc.\).

```go
type ErrorCode = schemaregistry.SchemaRegistryErrorCode
```

<a name="ErrorDetails"></a>
## type [ErrorDetails](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L39>)

ErrorDetails represents additional details about an error, if available.

```go
type ErrorDetails = schemaregistry.SchemaRegistryErrorDetails
```

<a name="ErrorTarget"></a>
## type [ErrorTarget](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L43>)

ErrorTarget represents the target of the error, if applicable \(e.g., 'schemaType'\).

```go
type ErrorTarget = schemaregistry.SchemaRegistryErrorTarget
```

<a name="Format"></a>
## type [Format](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L12>)

Format represents the encoding used to store the schema. It specifies how the schema content should be interpreted.

```go
type Format = schemaregistry.Format
```

<a name="GetOption"></a>
## type [GetOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/get.go#L16>)

GetOption represents a single option for the Get method.

```go
type GetOption interface {
    // contains filtered or unexported methods
}
```

<a name="GetOptions"></a>
## type [GetOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/get.go#L19-L22>)

GetOptions are the resolved options for the Get method.

```go
type GetOptions struct {
    Timeout time.Duration
    Version string
}
```

<a name="GetOptions.Apply"></a>
### func \(\*GetOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/get.go#L53>)

```go
func (o *GetOptions) Apply(opts []GetOption, rest ...GetOption)
```

Apply resolves the provided list of options.

<a name="PutOption"></a>
## type [PutOption](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/put.go#L17>)

PutOption represents a single option for the Put method.

```go
type PutOption interface {
    // contains filtered or unexported methods
}
```

<a name="PutOptions"></a>
## type [PutOptions](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/put.go#L20-L25>)

PutOptions are the resolved options for the Put method.

```go
type PutOptions struct {
    SchemaType SchemaType
    Tags       map[string]string
    Timeout    time.Duration
    Version    string
}
```

<a name="PutOptions.Apply"></a>
### func \(\*PutOptions\) [Apply](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/put.go#L60>)

```go
func (o *PutOptions) Apply(opts []PutOption, rest ...PutOption)
```

Apply resolves the provided list of options.

<a name="Schema"></a>
## type [Schema](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L8>)

Schema represents the stored schema payload.

```go
type Schema = schemaregistry.Schema
```

<a name="SchemaType"></a>
## type [SchemaType](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/alias.go#L20>)

SchemaType represents the type of the schema.

```go
type SchemaType = schemaregistry.SchemaType
```

<a name="WithSchemaType"></a>
## type [WithSchemaType](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/options.go#L13>)

WithSchemaType specifies the type of this schema. Defaults to MessageSchema.

```go
type WithSchemaType SchemaType
```

<a name="WithTags"></a>
## type [WithTags](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/options.go#L16>)

WithTags specifies optional metadata tags to associate with the schema.

```go
type WithTags map[string]string
```

<a name="WithTimeout"></a>
## type [WithTimeout](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/options.go#L19>)

WithTimeout adds a timeout to the request \(with second precision\).

```go
type WithTimeout time.Duration
```

<a name="WithVersion"></a>
## type [WithVersion](<https://github.com/Azure/iot-operations-sdks/blob/main/go/services/schemaregistry/options.go#L23>)

WithVersion specifies the semantic version of the schema. Defaults to "1.0.0".

```go
type WithVersion string
```

Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
