schema

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRequest

type CreateRequest struct {
	Name   string      `json:"name"`
	Schema interface{} `json:"schema"`
}

CreateRequest is the request to create a schema

type CreateResponse

type CreateResponse struct {
	ID        string      `json:"id"`
	Name      string      `json:"name"`
	Schema    interface{} `json:"schema"`
	UIConfig  interface{} `json:"uiConfig,omitempty"`
	CreatedAt string      `json:"createdAt"`
	UpdatedAt string      `json:"updatedAt"`
}

CreateResponse is the response from creating a schema

type DeleteRequest

type DeleteRequest struct {
	ID string `uri:"id"`
}

DeleteRequest is the request to delete a schema

type GetRequest

type GetRequest struct {
	ID string `uri:"id"`
}

GetRequest is the request to get a schema

type GetResponse

type GetResponse struct {
	ID        string      `json:"id"`
	Name      string      `json:"name"`
	Schema    interface{} `json:"schema"`
	UIConfig  interface{} `json:"uiConfig,omitempty"`
	CreatedAt string      `json:"createdAt"`
	UpdatedAt string      `json:"updatedAt"`
}

GetResponse is the response with schema details

type GetUIConfigRequest

type GetUIConfigRequest struct {
	ID string `uri:"id"`
}

GetUIConfigRequest is the request to get UI config for a schema

type GetUIConfigResponse

type GetUIConfigResponse struct {
	ID       string      `json:"id"`
	UIConfig interface{} `json:"uiConfig,omitempty"`
}

GetUIConfigResponse is the response with UI config

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Create

func (h *Handler) Create(c *gin.Context)

Create handles the request to create a schema

func (*Handler) Delete

func (h *Handler) Delete(c *gin.Context)

Delete handles the request to delete a schema

func (*Handler) Get

func (h *Handler) Get(c *gin.Context)

Get handles the request to get schema details

func (*Handler) GetUIConfig

func (h *Handler) GetUIConfig(c *gin.Context)

GetUIConfig handles the request to get schema UI config

func (*Handler) List

func (h *Handler) List(c *gin.Context)

List handles the request to list schemas

func (*Handler) RawValidate

func (h *Handler) RawValidate(c *gin.Context)

RawValidate handles the request to validate data against a raw schema

func (*Handler) Update

func (h *Handler) Update(c *gin.Context)

Update handles the request to update a schema

func (*Handler) UpdateUIConfig

func (h *Handler) UpdateUIConfig(c *gin.Context)

UpdateUIConfig handles the request to update schema UI config

func (*Handler) Validate

func (h *Handler) Validate(c *gin.Context)

Validate handles the request to validate data against a schema

type ListRequest

type ListRequest struct {
	Page     int `form:"page"`
	PageSize int `form:"pageSize"`
}

ListRequest is the request to list schemas

type ListResponse

type ListResponse struct {
	Items []SchemaItem `json:"items"`
	Total int          `json:"total"`
}

ListResponse is the response with schema list

type RawValidateRequest

type RawValidateRequest struct {
	Schema interface{} `json:"schema"`
	Data   interface{} `json:"data"`
}

RawValidateRequest is the request to validate data against a raw schema

type RawValidateResponse

type RawValidateResponse struct {
	Valid  bool     `json:"valid"`
	Errors []string `json:"errors,omitempty"`
}

RawValidateResponse is the response from raw validation

type SchemaCreateRequest

type SchemaCreateRequest struct {
	Name   string      `json:"name"`
	Schema interface{} `json:"schema"`
}

type SchemaCreateResponse

type SchemaCreateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaDeleteRequest

type SchemaDeleteRequest struct {
	ID string `uri:"id"`
}

type SchemaDeleteResponse

type SchemaDeleteResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaDetailRequest

type SchemaDetailRequest struct {
	ID string `uri:"id"`
}

type SchemaDetailResponse

type SchemaDetailResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaItem

type SchemaItem struct {
	ID        string      `json:"id"`
	Name      string      `json:"name"`
	Schema    interface{} `json:"schema"`
	UIConfig  interface{} `json:"uiConfig,omitempty"`
	CreatedAt string      `json:"createdAt"`
	UpdatedAt string      `json:"updatedAt"`
}

SchemaItem represents a schema item in the system

type SchemaRawValidateRequest

type SchemaRawValidateRequest struct {
	Schema interface{} `json:"schema"`
	Data   interface{} `json:"data"`
}

type SchemaRawValidateResponse

type SchemaRawValidateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaUIConfigRequest

type SchemaUIConfigRequest struct {
	ID string `uri:"id"`
}

type SchemaUIConfigResponse

type SchemaUIConfigResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaUIConfigUpdateRequest

type SchemaUIConfigUpdateRequest struct {
	ID     string      `uri:"id"`
	Config interface{} `json:"config"`
}

type SchemaUIConfigUpdateResponse

type SchemaUIConfigUpdateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaUpdateRequest

type SchemaUpdateRequest struct {
	ID     string      `uri:"id"`
	Schema interface{} `json:"schema"`
}

type SchemaUpdateResponse

type SchemaUpdateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemaValidateRequest

type SchemaValidateRequest struct {
	ID   string      `uri:"id"`
	Data interface{} `json:"data"`
}

type SchemaValidateResponse

type SchemaValidateResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type SchemasListRequest

type SchemasListRequest struct {
	Page     int `form:"page"`
	PageSize int `form:"pageSize"`
}

type SchemasListResponse

type SchemasListResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) Create

func (s *Service) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create creates a new schema

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *DeleteRequest) error

Delete deletes a schema

func (*Service) Get

func (s *Service) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)

Get returns a schema by ID

func (*Service) GetUIConfig

func (s *Service) GetUIConfig(ctx context.Context, req *GetUIConfigRequest) (*GetUIConfigResponse, error)

GetUIConfig returns the UI config for a schema

func (*Service) List

func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

List returns a list of schemas

func (*Service) RawValidate

func (s *Service) RawValidate(ctx context.Context, req *RawValidateRequest) (*RawValidateResponse, error)

RawValidate validates data against a raw schema

func (*Service) Update

func (s *Service) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)

Update updates a schema

func (*Service) UpdateUIConfig

func (s *Service) UpdateUIConfig(ctx context.Context, req *UpdateUIConfigRequest) (*UpdateUIConfigResponse, error)

UpdateUIConfig updates the UI config for a schema

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, req *ValidateRequest) (*ValidateResponse, error)

Validate validates data against a schema

type UpdateRequest

type UpdateRequest struct {
	ID     string      `uri:"id"`
	Schema interface{} `json:"schema"`
}

UpdateRequest is the request to update a schema

type UpdateResponse

type UpdateResponse struct {
	ID        string      `json:"id"`
	Name      string      `json:"name"`
	Schema    interface{} `json:"schema"`
	UIConfig  interface{} `json:"uiConfig,omitempty"`
	CreatedAt string      `json:"createdAt"`
	UpdatedAt string      `json:"updatedAt"`
}

UpdateResponse is the response from updating a schema

type UpdateUIConfigRequest

type UpdateUIConfigRequest struct {
	ID     string      `uri:"id"`
	Config interface{} `json:"config"`
}

UpdateUIConfigRequest is the request to update UI config for a schema

type UpdateUIConfigResponse

type UpdateUIConfigResponse struct {
	ID       string      `json:"id"`
	UIConfig interface{} `json:"uiConfig,omitempty"`
}

UpdateUIConfigResponse is the response from updating UI config

type ValidateRequest

type ValidateRequest struct {
	ID   string      `uri:"id"`
	Data interface{} `json:"data"`
}

ValidateRequest is the request to validate data against a schema

type ValidateResponse

type ValidateResponse struct {
	Valid  bool     `json:"valid"`
	Errors []string `json:"errors,omitempty"`
}

ValidateResponse is the response from validation

Jump to

Keyboard shortcuts

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