Skip to content

Instantly share code, notes, and snippets.

@sumitasok
Created April 20, 2016 06:54
Show Gist options
  • Save sumitasok/f99c79754768d46b097e460eb20db8ff to your computer and use it in GitHub Desktop.
Save sumitasok/f99c79754768d46b097e460eb20db8ff to your computer and use it in GitHub Desktop.
Interface implementation for Golang, to ensure never ever unauthorised data is wrongly pulled.
// model
fund getPublicEvents(status, publish_status string, isPrivate bool)
EventMeta{}
Events {
GetALL() []Events
}
ManageEvent struct{
*EventMeta
}
me GetAll() []Events
me AllowedSTatus() []string -> "drafted", "published", "archived", "private_published"
PublicEvent struct{
*EventMeta
}
pe GetAll() []Events
pe AllowedSTatus() []string -> "published"
PlatformEvent struct{
*EventMeta
}
ple GetALL() []Events{}
ple AllowedSTatus() []string -> "drafted", "published", "archived", "deleted", "private_published"
getALL(Events, x params)
getByStatus(Events, "all")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment