Documentation ¶
Index ¶
- Variables
- func MakeCourceByData(c Client, data icarus.CourseData) (icarus.Course, error)
- func MakeUserByData(c Client, data icarus.UserData) (icarus.User, error)
- func RegisterHandle(handle string, cli Client) error
- func RegisterWorker(handle string, w Worker) error
- func RegisteredHandle() map[string]Client
- func RegisteredList() []string
- func RegisteredWorker() map[string]Worker
- func RegisteredWorkerList() []string
- type Client
- type Worker
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MakeCourceByData ¶
func RegisterHandle ¶
func RegisterWorker ¶
func RegisteredHandle ¶
func RegisteredList ¶
func RegisteredList() []string
func RegisteredWorker ¶
func RegisteredWorkerList ¶
func RegisteredWorkerList() []string
Types ¶
type Client ¶
type Client interface { // Factory functions of actual (not abstract) users and courses. MakeUser(userID string, password string) (icarus.User, error) MakeCourse(name string, desc string, token string) (icarus.Course, error) }
Client is in icarus (server part).
Server part invokes dispatcher to send task,
(most times the only needed work is to use standard dispatcher functions)
and the satellite part do the actual work.
type Worker ¶
type Worker interface { Login(data []string) []string ListCourse(data []string) []string Elect(data []string) []string }
Worker is in icarus-satellite.
What worker needs to do is to handle server's subtask and do actual response. All datum are transfered in []string so the worker need to understand server's
request correctly and generate suitable response. Errors should be coded in response so worker cannot generate any Go-style errors.
Click to show internal directories.
Click to hide internal directories.