Documentation ¶
Overview ¶
Package event is a generated GoMock package.
Index ¶
- Constants
- Variables
- type CreateWorkshopData
- type DBAPI
- type Env
- type EventData
- type EventInfo
- type MockDBAPI
- func (m *MockDBAPI) BeginTx(arg0 context.Context) (*sql.Tx, error)
- func (m *MockDBAPI) Commit(arg0 *sql.Tx) error
- func (m *MockDBAPI) CreateEvent(arg0 context.Context, arg1 *EventData) (*dbmodels.Event, error)
- func (m *MockDBAPI) CreateWorkshop(arg0 context.Context, arg1 *CreateWorkshopData) (*dbmodels.Workshop, error)
- func (m *MockDBAPI) EXPECT() *MockDBAPIMockRecorder
- func (m *MockDBAPI) GetEvent(arg0 context.Context, arg1 string) (*dbmodels.Event, error)
- func (m *MockDBAPI) ListWorkshops(arg0 context.Context, arg1 string, arg2 paging.Page) ([]WorkshopData, error)
- func (m *MockDBAPI) Rollback(arg0 *sql.Tx) error
- type MockDBAPIMockRecorder
- func (mr *MockDBAPIMockRecorder) BeginTx(arg0 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) Commit(arg0 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) CreateEvent(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) CreateWorkshop(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) GetEvent(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) ListWorkshops(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockDBAPIMockRecorder) Rollback(arg0 interface{}) *gomock.Call
- type Service
- func (s *Service) AddInfoHandlers(routerGroup *gin.RouterGroup)
- func (s *Service) CreateWorkshop(ctx *gin.Context) (workshop *m.Workshop, err error)
- func (s *Service) CreateWorkshopHandler() gin.HandlerFunc
- func (s *Service) ListWorkshopHandler() gin.HandlerFunc
- func (s *Service) ListWorkshops(ctx *gin.Context) (list WorkshopList, err error)
- func (s *Service) Run(ctx context.Context) (err error)
- type WorkshopData
- type WorkshopInfo
- type WorkshopList
Constants ¶
const ServiceName = "event"
Variables ¶
var ( ErrEventDoesNotExist = errors.New("event does not exist") ErrRetrieveWorkshopList = errors.New("retrieving workshop list failed") )
var ( GitCommit string Version string )
Build Variables picked up by govvv go get github.com/ahmetb/govvv
var (
)Functions ¶
This section is empty.
Types ¶
type CreateWorkshopData ¶
type CreateWorkshopData struct { ID string `json:"id"` InstanceID string `json:"instance"` WorkshopInfo // Starts must be provided as RFC 3339 strings Starts time.Time `json:"starts"` // Ends must be provided as RFC 3339 strings Ends *time.Time `json:"ends,omitempty"` EventID string `json:"eventID"` }
CreateWorkshopData describes a workshop to be created
type DBAPI ¶
type DBAPI interface { BeginTx(ctx context.Context) (*sql.Tx, error) Commit(tx *sql.Tx) error Rollback(tx *sql.Tx) error CreateWorkshop(ctx context.Context, data *CreateWorkshopData) (workshop *m.Workshop, err error) ListWorkshops(ctx context.Context, instanceID string, page paging.Page) (list WorkshopList, err error) CreateEvent(ctx context.Context, data *EventData) (event *m.Event, err error) GetEvent(ctx context.Context, eventID string) (event *m.Event, err error) }
type Env ¶
type Env struct { service.DBEnv tokens.TokenEnv service.HTTPEnv AllowOrigins []string // contains filtered or unexported fields }
Env is a hierarchical environment configuration for the authentication service and it's API handlers.
type EventData ¶
type EventData struct { InstanceID string `json:"instance"` EventInfo // Starts must be provided as RFC 3339 strings Starts time.Time `json:"starts"` // Ends must be provided as RFC 3339 strings Ends *time.Time `json:"ends,omitempty"` }
EventData describes an event
type MockDBAPI ¶
type MockDBAPI struct {
// contains filtered or unexported fields
}
MockDBAPI is a mock of DBAPI interface.
func NewMockDBAPI ¶
func NewMockDBAPI(ctrl *gomock.Controller) *MockDBAPI
NewMockDBAPI creates a new mock instance.
func (*MockDBAPI) CreateEvent ¶
CreateEvent mocks base method.
func (*MockDBAPI) CreateWorkshop ¶
func (m *MockDBAPI) CreateWorkshop(arg0 context.Context, arg1 *CreateWorkshopData) (*dbmodels.Workshop, error)
CreateWorkshop mocks base method.
func (*MockDBAPI) EXPECT ¶
func (m *MockDBAPI) EXPECT() *MockDBAPIMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDBAPI) ListWorkshops ¶
func (m *MockDBAPI) ListWorkshops(arg0 context.Context, arg1 string, arg2 paging.Page) ([]WorkshopData, error)
ListWorkshops mocks base method.
type MockDBAPIMockRecorder ¶
type MockDBAPIMockRecorder struct {
// contains filtered or unexported fields
}
MockDBAPIMockRecorder is the mock recorder for MockDBAPI.
func (*MockDBAPIMockRecorder) BeginTx ¶
func (mr *MockDBAPIMockRecorder) BeginTx(arg0 interface{}) *gomock.Call
BeginTx indicates an expected call of BeginTx.
func (*MockDBAPIMockRecorder) Commit ¶
func (mr *MockDBAPIMockRecorder) Commit(arg0 interface{}) *gomock.Call
Commit indicates an expected call of Commit.
func (*MockDBAPIMockRecorder) CreateEvent ¶
func (mr *MockDBAPIMockRecorder) CreateEvent(arg0, arg1 interface{}) *gomock.Call
CreateEvent indicates an expected call of CreateEvent.
func (*MockDBAPIMockRecorder) CreateWorkshop ¶
func (mr *MockDBAPIMockRecorder) CreateWorkshop(arg0, arg1 interface{}) *gomock.Call
CreateWorkshop indicates an expected call of CreateWorkshop.
func (*MockDBAPIMockRecorder) GetEvent ¶
func (mr *MockDBAPIMockRecorder) GetEvent(arg0, arg1 interface{}) *gomock.Call
GetEvent indicates an expected call of GetEvent.
func (*MockDBAPIMockRecorder) ListWorkshops ¶
func (mr *MockDBAPIMockRecorder) ListWorkshops(arg0, arg1, arg2 interface{}) *gomock.Call
ListWorkshops indicates an expected call of ListWorkshops.
func (*MockDBAPIMockRecorder) Rollback ¶
func (mr *MockDBAPIMockRecorder) Rollback(arg0 interface{}) *gomock.Call
Rollback indicates an expected call of Rollback.
type Service ¶
type Service struct { Env service.DBConn DBAPI DBAPI service.HTTPServer TokenAPI *tokens.TokenController AllowOrigins map[string]struct{} }
Service offers the APIs of the authentication service. This struct holds hierarchically structured state that is shared between requests.
func (*Service) AddInfoHandlers ¶
func (s *Service) AddInfoHandlers(routerGroup *gin.RouterGroup)
AddInfoHandlers adds new handlers to retrieve model structure info.
func (*Service) CreateWorkshop ¶
func (*Service) CreateWorkshopHandler ¶
func (s *Service) CreateWorkshopHandler() gin.HandlerFunc
CreateWorkshopHandler creates a new workshop.
func (*Service) ListWorkshopHandler ¶
func (s *Service) ListWorkshopHandler() gin.HandlerFunc
ListWorkshopHandler lists workshops.
func (*Service) ListWorkshops ¶
func (s *Service) ListWorkshops(ctx *gin.Context) (list WorkshopList, err error)
type WorkshopData ¶
type WorkshopData struct { ID string `json:"id"` WorkshopInfo // Starts must be provided as RFC 3339 strings Starts time.Time `json:"starts"` // Ends must be provided as RFC 3339 strings Ends *time.Time `json:"ends,omitempty"` EventID string `json:"eventID"` EventData EventData `json:"event"` }
WorkshopData describes a returned workshop
type WorkshopInfo ¶
type WorkshopList ¶
type WorkshopList struct { Workshops []WorkshopData `json:"items"` Paging paging.Paging `json:"paging"` }
WorkshopList describes the returned workshop list with paging.