Skip to content

Commit

Permalink
remove duplicated interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
xiam committed Aug 27, 2020
1 parent 08f658f commit 83db141
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
14 changes: 0 additions & 14 deletions record.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,61 +33,47 @@ type HasConstraints interface {
// records that is called before persisting a record (creating or updating). If
// Validate returns an error the current operation is rolled back.
type Validator interface {
Record

Validate() error
}

// BeforeCreateHook is an interface that defines an BeforeCreate function for
// records that is called before creating a record. If BeforeCreate returns an
// error the create process is rolled back.
type BeforeCreateHook interface {
Record

BeforeCreate(Session) error
}

// AfterCreateHook is an interface that defines an AfterCreate function for
// records that is called after creating a record. If AfterCreate returns an
// error the create process is rolled back.
type AfterCreateHook interface {
Record

AfterCreate(Session) error
}

// BeforeUpdateHook is an interface that defines a BeforeUpdate function for
// records that is called before updating a record. If BeforeUpdate returns an
// error the update process is rolled back.
type BeforeUpdateHook interface {
Record

BeforeUpdate(Session) error
}

// AfterUpdateHook is an interface that defines an AfterUpdate function for
// records that is called after updating a record. If AfterUpdate returns an
// error the update process is rolled back.
type AfterUpdateHook interface {
Record

AfterUpdate(Session) error
}

// BeforeDeleteHook is an interface that defines a BeforeDelete function for
// records that is called before removing a record. If BeforeDelete returns an
// error the delete process is rolled back.
type BeforeDeleteHook interface {
Record

BeforeDelete(Session) error
}

// AfterDeleteHook is an interface that defines a AfterDelete function for
// records that is called after removing a record. If AfterDelete returns
// an error the delete process is rolled back.
type AfterDeleteHook interface {
Record

AfterDelete(Session) error
}
10 changes: 0 additions & 10 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,21 @@ type Store interface {
}

type StoreSaver interface {
Store

Save(record Record) error
}

type StoreCreator interface {
Store

Create(record Record) error
}

type StoreDeleter interface {
Store

Delete(record Record) error
}

type StoreUpdater interface {
Store

Update(record Record) error
}

type StoreGetter interface {
Store

Get(record Record, id interface{}) error
}

0 comments on commit 83db141

Please sign in to comment.