Documentation ¶
Index ¶
- type Pet
- type Repository
- func (r *Repository) DeleteAll(ctx context.Context) error
- func (r *Repository) DeleteOne(ctx context.Context, id string) error
- func (r *Repository) InsertOne(ctx context.Context, item *Pet) (*Pet, error)
- func (r *Repository) SelectAll(ctx context.Context) ([]Pet, error)
- func (r *Repository) SelectOne(ctx context.Context, id string) (*Pet, error)
- func (r *Repository) UpdateOne(ctx context.Context, id string, title string) (*Pet, error)
- type Service
- func (s *Service) Create(ctx context.Context, item *Pet) (*Pet, error)
- func (s *Service) Get(ctx context.Context, id string) (*Pet, error)
- func (s *Service) List(ctx context.Context) ([]Pet, error)
- func (s *Service) Remove(ctx context.Context, id string) error
- func (s *Service) RemoveAll(ctx context.Context) error
- func (s *Service) Update(ctx context.Context, id string, title string) (*Pet, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pet ¶
type Pet struct { ID string `json:"id"` Title string `json:"title"` Price int32 `json:"price"` FeatureTags []string `json:"feature_tags"` Attrs map[string]interface{} `json:"attrs"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` Ver int32 `json:"ver"` }
Pet is the pet model
type Repository ¶
Repository is the data access object for pet
func (*Repository) DeleteAll ¶
func (r *Repository) DeleteAll(ctx context.Context) error
DeleteAll deletes all pets
func (*Repository) DeleteOne ¶
func (r *Repository) DeleteOne(ctx context.Context, id string) error
DeleteOne deletes a pet by ID
func (*Repository) SelectAll ¶
func (r *Repository) SelectAll(ctx context.Context) ([]Pet, error)
SelectAll selects all pets
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the pet service
Click to show internal directories.
Click to hide internal directories.