package display import ( "fmt" "image" "io" "log" ) type Display interface { Flush(img *image.Gray) error GetBounds() image.Rectangle io.Closer } type DisplayModel int const ( SSD1306 DisplayModel = iota MT12864A ) func New(logger *log.Logger, model DisplayModel) (Display, error) { switch model { case SSD1306: return newSsd1306(logger) case MT12864A: return newMt12864a(logger) } return nil, fmt.Errorf("invalid display model") }