Documentation
¶
Index ¶
- Variables
- type ServersController
- func (sc *ServersController) All(w http.ResponseWriter, r *http.Request)
- func (sc *ServersController) Create(w http.ResponseWriter, r *http.Request)
- func (sc *ServersController) HandleRoutes(router *mux.Router)
- func (sc *ServersController) Join(w http.ResponseWriter, r *http.Request)
- func (sc *ServersController) Leave(w http.ResponseWriter, r *http.Request)
- func (sc *ServersController) Start(w http.ResponseWriter, r *http.Request)
- type ServersEntity
- type ServersRepository
- func (sr *ServersRepository) Create(server *ServersEntity) (*ServersEntity, error)
- func (sr *ServersRepository) Delete(id int) error
- func (sr *ServersRepository) FindById(id int) (*ServersEntity, error)
- func (sr *ServersRepository) ReadAll() []*ServersEntity
- func (sr *ServersRepository) Update(id int, server *ServersEntity) (*ServersEntity, error)
- type ServersService
- func (ss *ServersService) All() []*ServersEntity
- func (ss *ServersService) CreateUserServer(userId int) (*ServersEntity, error)
- func (ss *ServersService) JoinUserServer(serverId, userId int) error
- func (ss *ServersService) LeaveUserServer(serverId, userId int) error
- func (ss *ServersService) StartServer(serverId int) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = wire.NewSet( NewServersController, NewServersService, NewServersRepository, )
Functions ¶
This section is empty.
Types ¶
type ServersController ¶
type ServersController struct {
// contains filtered or unexported fields
}
func NewServersController ¶
func NewServersController(serversService *ServersService) *ServersController
func (*ServersController) All ¶
func (sc *ServersController) All(w http.ResponseWriter, r *http.Request)
func (*ServersController) Create ¶
func (sc *ServersController) Create(w http.ResponseWriter, r *http.Request)
func (*ServersController) HandleRoutes ¶
func (sc *ServersController) HandleRoutes(router *mux.Router)
func (*ServersController) Join ¶
func (sc *ServersController) Join(w http.ResponseWriter, r *http.Request)
func (*ServersController) Leave ¶
func (sc *ServersController) Leave(w http.ResponseWriter, r *http.Request)
func (*ServersController) Start ¶
func (sc *ServersController) Start(w http.ResponseWriter, r *http.Request)
type ServersEntity ¶
type ServersEntity struct {
Id int `json:"id"`
Title string `json:"title"`
Users []*users.UsersEntity `json:"users"`
}
func NewServersEntityFromServersEntity ¶
func NewServersEntityFromServersEntity(entity ServersEntity) *ServersEntity
func NewServersEntityFromUsersEntity ¶
func NewServersEntityFromUsersEntity(entity users.UsersEntity) *ServersEntity
func (*ServersEntity) AddUser ¶
func (se *ServersEntity) AddUser(user users.UsersEntity)
func (*ServersEntity) RemoveUser ¶
func (se *ServersEntity) RemoveUser(user users.UsersEntity)
func (*ServersEntity) ToServer ¶
func (se *ServersEntity) ToServer() *system.Server
type ServersRepository ¶
type ServersRepository struct {
// contains filtered or unexported fields
}
func NewServersRepository ¶
func NewServersRepository() *ServersRepository
func (*ServersRepository) Create ¶
func (sr *ServersRepository) Create(server *ServersEntity) (*ServersEntity, error)
func (*ServersRepository) Delete ¶
func (sr *ServersRepository) Delete(id int) error
func (*ServersRepository) FindById ¶
func (sr *ServersRepository) FindById(id int) (*ServersEntity, error)
func (*ServersRepository) ReadAll ¶
func (sr *ServersRepository) ReadAll() []*ServersEntity
func (*ServersRepository) Update ¶
func (sr *ServersRepository) Update(id int, server *ServersEntity) (*ServersEntity, error)
type ServersService ¶
type ServersService struct {
// contains filtered or unexported fields
}
func NewServersService ¶
func NewServersService( serversRepository *ServersRepository, usersService *users.UsersService, manager *engine.Manager, ) *ServersService
func (*ServersService) All ¶
func (ss *ServersService) All() []*ServersEntity
func (*ServersService) CreateUserServer ¶
func (ss *ServersService) CreateUserServer(userId int) (*ServersEntity, error)
func (*ServersService) JoinUserServer ¶
func (ss *ServersService) JoinUserServer(serverId, userId int) error
func (*ServersService) LeaveUserServer ¶
func (ss *ServersService) LeaveUserServer(serverId, userId int) error
func (*ServersService) StartServer ¶
func (ss *ServersService) StartServer(serverId int) error
Click to show internal directories.
Click to hide internal directories.