Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryRepo ¶
type InMemoryRepo struct {
// contains filtered or unexported fields
}
InMemoryRepo implements Repository in a very simple implementation (in memory).
func NewInMemoryRepo ¶
func NewInMemoryRepo() *InMemoryRepo
NewInMemoryRepo creates a new InMemoryRepo.
func (InMemoryRepo) Delete ¶
func (repo InMemoryRepo) Delete(_ context.Context, id string) error
Delete erases the entity in the repository.
type Job ¶
type Job struct { Company string `json:"company"` Title string `json:"title"` Description string `json:"description,omitempty"` }
Job contains the business model data.
type Repository ¶
type Repository interface { Get(ctx context.Context, id string) (Job, bool, error) Create(ctx context.Context, job Job) (string, error) Update(ctx context.Context, id string, job Job) error Delete(ctx context.Context, id string) error }
Repository implements the behaviour to get, create, update and delete information from a general repository.
Click to show internal directories.
Click to hide internal directories.