Documentation ¶
Index ¶
- func ClearImage(conn redis.Conn) error
- func ConnectRedis(dsn string, maxActive int) (*redis.Pool, error)
- func GetImage(conn redis.Conn) (image.Image, error)
- func HandleCreatePixel(pool *redis.Pool) http.HandlerFunc
- func HandleGetBoard(pool *redis.Pool) http.HandlerFunc
- func HandleGetBoardBitmap(pool *redis.Pool) http.HandlerFunc
- func HandleLiveConnection(pool *redis.Pool, psconn redis.Conn) http.HandlerFunc
- func InitImage(conn redis.Conn) error
- func PublishPixel(conn redis.Conn, px Pixel) error
- func SendSet(conn redis.Conn, x, y, colour uint32) error
- func SetColour(conn redis.Conn, px Pixel) error
- func StartServer(addr string, pool *redis.Pool, conn redis.Conn, corsOrigins []string) error
- func TestImage(conn redis.Conn) error
- type Pixel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectRedis ¶
ConnectRedis connects to the redis instance, pings it, and returns the pool object on sucesfull connect.
func HandleCreatePixel ¶
func HandleCreatePixel(pool *redis.Pool) http.HandlerFunc
HandleCreatePixel handles creating pixels on the image.
func HandleGetBoard ¶
func HandleGetBoard(pool *redis.Pool) http.HandlerFunc
HandleGetBoard handles serving the board as a png image.
func HandleGetBoardBitmap ¶
func HandleGetBoardBitmap(pool *redis.Pool) http.HandlerFunc
HandleGetBoardBitmap handles serving the board as a png image.
func HandleLiveConnection ¶
HandleLiveConnection brokers the websocket connection with redis.
func PublishPixel ¶
PublishPixel publishes the pixel as it was created to redis by sending the redis command for PUBLISH, it does not flush the command.
func StartServer ¶
StartServer runs an http server capable of serving requests for the image service.
Types ¶
Click to show internal directories.
Click to hide internal directories.