i dunno if this makes things clearer or not
parent
a1e405363b
commit
cc1256d99c
@ -1,21 +1,45 @@
|
|||||||
|
// RequestMeta contains metadata about an http request as received by the http
|
||||||
|
// server
|
||||||
struct RequestMeta {
|
struct RequestMeta {
|
||||||
|
// seq is a request identifier that can be used to relate incoming requests
|
||||||
|
// to outgoing responses.
|
||||||
int seq;
|
int seq;
|
||||||
char *path;
|
char *path;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct RequestMeta RequestMeta;
|
typedef struct RequestMeta RequestMeta;
|
||||||
|
|
||||||
|
// ResponseMeta contains metadata about an http request as sent by the http
|
||||||
|
// server
|
||||||
struct ResponseMeta {
|
struct ResponseMeta {
|
||||||
int seq;
|
int seq; // same id as the originating request
|
||||||
int status;
|
int status; // http status code
|
||||||
int bytes;
|
int bytes; // number of bytes written in the response
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct ResponseMeta ResponseMeta;
|
typedef struct ResponseMeta ResponseMeta;
|
||||||
|
|
||||||
void initialize();
|
// the Go backend calls initialize to allow the frontend to perform any up
|
||||||
int run();
|
// front allocations or reserve any resources it might need.
|
||||||
void shutdown();
|
void ui_init();
|
||||||
void set_root(char *);
|
|
||||||
void received_request(RequestMeta *);
|
// the Go backend calls run to start the front end's main event loop. this
|
||||||
void sent_response(ResponseMeta *);
|
// function is expected to block until the front end is done and the
|
||||||
|
// application is ready to terminate.
|
||||||
|
int ui_run();
|
||||||
|
|
||||||
|
// shutdown is provided to allow the Go backend to signal to the frontend that
|
||||||
|
// it believes the program should be shut down for some reason outside of user
|
||||||
|
// interaction.
|
||||||
|
void bg_shutdown();
|
||||||
|
|
||||||
|
// set_root informs the front end that the webserver has set its root directory
|
||||||
|
void bg_set_root(char *);
|
||||||
|
|
||||||
|
// received_request informs the front end that the webserver has received an
|
||||||
|
// http request.
|
||||||
|
void bg_received_request(RequestMeta *);
|
||||||
|
|
||||||
|
// sent_response informs the front end that the webserver has completed serving
|
||||||
|
// a response.
|
||||||
|
void bg_sent_response(ResponseMeta *);
|
||||||
|
Loading…
Reference in New Issue