sumitasok
4/20/2016 - 6:54 AM

Interface implementation for Golang, to ensure never ever unauthorised data is wrongly pulled.

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")