Skip to content

Instantly share code, notes, and snippets.

@sumitasok
Created May 27, 2016 10:37
Show Gist options
  • Save sumitasok/619eccbb8a95084f1e4376b59f8d09a5 to your computer and use it in GitHub Desktop.
Save sumitasok/619eccbb8a95084f1e4376b59f8d09a5 to your computer and use it in GitHub Desktop.
Design for Crud method interface for apis.V2
type Controler struct{
}
func c Controller Config() apis.Config{} {}
func c Controller BeforeFilters() []actions {
if Methdo == "POST" {
retuen []actions{}
} esles is "PUT"
}
func c Controller Create(d apis.Dispatcher){}
func c Controller Update(d apis.Dispatcher){}
func c Controller Read(d apis.Dispatcher){}
func c Controller Delete(d apis.Dispatcher){}
func c Controller AfterFilters() []actions {
if Methdo == "POST" || "PUT" {
retuen []actions{}
} esles is "PUT"
}
// sael.CRUD("tickets").Set(salesC.Contrller{})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment