Documentation
¶
Index ¶
- type CreateRequest
- type CreateResponse
- type DeleteRequest
- type GetRequest
- type GetResponse
- type GetUIConfigRequest
- type GetUIConfigResponse
- type Handler
- func (h *Handler) Create(c *gin.Context)
- func (h *Handler) Delete(c *gin.Context)
- func (h *Handler) Get(c *gin.Context)
- func (h *Handler) GetUIConfig(c *gin.Context)
- func (h *Handler) List(c *gin.Context)
- func (h *Handler) RawValidate(c *gin.Context)
- func (h *Handler) Update(c *gin.Context)
- func (h *Handler) UpdateUIConfig(c *gin.Context)
- func (h *Handler) Validate(c *gin.Context)
- type ListRequest
- type ListResponse
- type RawValidateRequest
- type RawValidateResponse
- type SchemaCreateRequest
- type SchemaCreateResponse
- type SchemaDeleteRequest
- type SchemaDeleteResponse
- type SchemaDetailRequest
- type SchemaDetailResponse
- type SchemaItem
- type SchemaRawValidateRequest
- type SchemaRawValidateResponse
- type SchemaUIConfigRequest
- type SchemaUIConfigResponse
- type SchemaUIConfigUpdateRequest
- type SchemaUIConfigUpdateResponse
- type SchemaUpdateRequest
- type SchemaUpdateResponse
- type SchemaValidateRequest
- type SchemaValidateResponse
- type SchemasListRequest
- type SchemasListResponse
- type Service
- func (s *Service) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)
- func (s *Service) Delete(ctx context.Context, req *DeleteRequest) error
- func (s *Service) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)
- func (s *Service) GetUIConfig(ctx context.Context, req *GetUIConfigRequest) (*GetUIConfigResponse, error)
- func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)
- func (s *Service) RawValidate(ctx context.Context, req *RawValidateRequest) (*RawValidateResponse, error)
- func (s *Service) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
- func (s *Service) UpdateUIConfig(ctx context.Context, req *UpdateUIConfigRequest) (*UpdateUIConfigResponse, error)
- func (s *Service) Validate(ctx context.Context, req *ValidateRequest) (*ValidateResponse, error)
- type UpdateRequest
- type UpdateResponse
- type UpdateUIConfigRequest
- type UpdateUIConfigResponse
- type ValidateRequest
- type ValidateResponse
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 (*Handler) GetUIConfig ¶
GetUIConfig handles the request to get schema UI config
func (*Handler) RawValidate ¶
RawValidate handles the request to validate data against a raw schema
func (*Handler) UpdateUIConfig ¶
UpdateUIConfig handles the request to update schema UI config
type ListRequest ¶
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 SchemaDeleteRequest ¶
type SchemaDeleteRequest struct {
ID string `uri:"id"`
}
type SchemaDeleteResponse ¶
type SchemaDetailRequest ¶
type SchemaDetailRequest struct {
ID string `uri:"id"`
}
type SchemaDetailResponse ¶
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 SchemaUIConfigRequest ¶
type SchemaUIConfigRequest struct {
ID string `uri:"id"`
}
type SchemaUIConfigResponse ¶
type SchemaUIConfigUpdateRequest ¶
type SchemaUIConfigUpdateRequest struct {
ID string `uri:"id"`
Config interface{} `json:"config"`
}
type SchemaUpdateRequest ¶
type SchemaUpdateRequest struct {
ID string `uri:"id"`
Schema interface{} `json:"schema"`
}
type SchemaUpdateResponse ¶
type SchemaValidateRequest ¶
type SchemaValidateRequest struct {
ID string `uri:"id"`
Data interface{} `json:"data"`
}
type SchemaValidateResponse ¶
type SchemasListRequest ¶
type SchemasListResponse ¶
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