Documentation
¶
Index ¶
- Constants
- func Delete(schemaUUID string, str stores.Store) error
- func ExistsWithName(projectUUID string, schemaName string, str stores.Store) (bool, error)
- func ExtractSchema(schemaRef string) (string, string, error)
- func FormatSchemaRef(projectName, schemaName string) string
- func ValidateMessages(schema Schema, msgList messages.MsgList) error
- type Schema
- type SchemaList
Constants ¶
View Source
const ( JSON = "json" UnsupportedSchemaError = `Schema type can only be 'json'` GenericError = "Could not load schema for topic" )
Variables ¶
This section is empty.
Functions ¶
func ExistsWithName ¶
ExistsWithName checks if a schema with the given name exists under the given project
func ExtractSchema ¶
ExtractSchema gets a full schema ref and extracts project and schema the format of the schema ref should follow the pattern projects/{project}/schemas/schema
func FormatSchemaRef ¶
FormatSchemaRef formats the full resource reference for a schema format is projects/{project}/schemas/{schema}
Types ¶
type Schema ¶
type Schema struct { ProjectUUID string `json:"-"` UUID string `json:"uuid"` Name string `json:"-"` FullName string `json:"name"` Type string `json:"type"` RawSchema map[string]interface{} `json:"schema"` }
Schema holds information regarding a schema that will be used to validate a topic's published messages
type SchemaList ¶
type SchemaList struct {
Schemas []Schema `json:"schemas"`
}
SchemaList is a wrapper for a slice of schemas
func Find ¶
func Find(projectUUID, schemaUUID, schemaName string, str stores.Store) (SchemaList, error)
Find retrieves a specific schema or all the schemas under a project
func (*SchemaList) Empty ¶
func (sl *SchemaList) Empty() bool
Empty returns weather or not there are any schemas inside the schema list
Click to show internal directories.
Click to hide internal directories.