examples

package
v0.0.0-...-6260bc3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersistableSampleRepository

type PersistableSampleRepository struct {
	SampleRepository
}

func NewPersistableSampleRepository

func NewPersistableSampleRepository(ctx context.Context, logger ...rest.Logger) *PersistableSampleRepository

func (*PersistableSampleRepository) Delete

func (*PersistableSampleRepository) Save

func (r *PersistableSampleRepository) Save(entity interface{}) (string, error)

func (*PersistableSampleRepository) Update

func (r *PersistableSampleRepository) Update(id string, entity interface{}, cols ...string) error

type ReadWriteRepository

type ReadWriteRepository interface {
	rest.Repository
	rest.Persistable
}

type SampleModel

type SampleModel struct {
	ID   string
	Name string
	Age  int
}

type SampleRepository

type SampleRepository struct {
	Context context.Context
	Error   error
	// contains filtered or unexported fields
}

SampleRepository is a simple in-memory repository implementation. NOTE: This repository does not handle QueryOptions

func NewSampleRepository

func NewSampleRepository(ctx context.Context, logger ...rest.Logger) *SampleRepository

NewSampleRepository returns a new SampleRepository

func (*SampleRepository) Count

func (r *SampleRepository) Count(options ...rest.QueryOptions) (int64, error)

func (*SampleRepository) EntityName

func (r *SampleRepository) EntityName() string

func (*SampleRepository) NewInstance

func (r *SampleRepository) NewInstance() interface{}

func (*SampleRepository) Read

func (r *SampleRepository) Read(id string) (interface{}, error)

func (*SampleRepository) ReadAll

func (r *SampleRepository) ReadAll(options ...rest.QueryOptions) (interface{}, error)

Jump to

Keyboard shortcuts

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