handler

package
v0.0.0-...-9c44629 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Moirai

type Moirai struct {
	Storage `inject:"schema_storage"`

	Validator Validator `inject:"schema_validator"`
}

func (*Moirai) CreateRecords

func (m *Moirai) CreateRecords(ctx context.Context, records *proto.Records) (*proto.Records, error)

func (*Moirai) CreateSchema

func (m *Moirai) CreateSchema(ctx context.Context, req *proto.Schema) (*proto.Schema, error)

func (*Moirai) GetSchema

func (m *Moirai) GetSchema(ctx context.Context, req *proto.RequestObjectById) (*proto.Schema, error)

func (*Moirai) UpdateRecord

func (m *Moirai) UpdateRecord(ctx context.Context, req *proto.Record) (*proto.Record, error)

func (*Moirai) Version

type Storage

type Storage interface {
	WriteSchema(schema *model.Schema) error
	GetSchema(uuid uuid.UUID) (*model.Schema, error)
	WriteRecord(schema model.Schema, record *model.Record) (*model.Record, error)
	UpdateRecord(schema model.Schema, record *model.Record) (*model.Record, error)
}

type Validator

type Validator interface {
	Validate(schema model.Schema, record *structpb.Struct, opts ...model.JsonValidatorOption) []errors.FieldError
}

Jump to

Keyboard shortcuts

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