Documentation ¶
Index ¶
- Variables
- type MetaSchema
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, toCreate MetaSchema) (MetaSchema, error)
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) Get(ctx context.Context, idOrName string) (MetaSchema, error)
- func (s Service) List(ctx context.Context) ([]MetaSchema, error)
- func (s Service) MigrateDefault(ctx context.Context) error
- func (s Service) Update(ctx context.Context, id string, toUpdate MetaSchema) (MetaSchema, error)
- func (s Service) Validate(mdata metadata.Metadata, name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidID = errors.New("metaschema id is invalid") ErrNotExist = errors.New("metaschema doesn't exist") ErrConflict = errors.New("metaschema already exist") ErrInvalidDetail = errors.New("invalid metadata detail") ErrInvalidMetaSchema = errors.New("metadata schema validation failed") )
Functions ¶
This section is empty.
Types ¶
type MetaSchema ¶
type MetaSchema struct { ID string Name string Schema string CreatedAt time.Time UpdatedAt time.Time }
MetaSchema represents metadata schema to be validated for users/ groups/ organisations / roles
type Repository ¶
type Repository interface { Create(ctx context.Context, metaschema MetaSchema) (MetaSchema, error) Get(ctx context.Context, id string) (MetaSchema, error) Update(ctx context.Context, id string, metaschema MetaSchema) (MetaSchema, error) List(ctx context.Context) ([]MetaSchema, error) Delete(ctx context.Context, id string) (string, error) MigrateDefaults(ctx context.Context) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository) *Service
func (Service) Create ¶
func (s Service) Create(ctx context.Context, toCreate MetaSchema) (MetaSchema, error)
func (Service) Update ¶
func (s Service) Update(ctx context.Context, id string, toUpdate MetaSchema) (MetaSchema, error)
Click to show internal directories.
Click to hide internal directories.