Refine API of webtty package

This commit is contained in:
Iwasaki Yudai 2017-08-24 14:40:28 +09:00
parent d1ec7125cf
commit 807bcc25a4
10 changed files with 82 additions and 97 deletions

View file

@ -17,11 +17,18 @@ func WithPermitWrite() Option {
}
}
// WithFixedSize sets a fixed size to TTY master.
func WithFixedSize(width int, height int) Option {
// WithFixedColumns sets a fixed width to TTY master.
func WithFixedColumns(columns int) Option {
return func(wt *WebTTY) error {
wt.width = width
wt.height = height
wt.columns = columns
return nil
}
}
// WithFixedRows sets a fixed height to TTY master.
func WithFixedRows(rows int) Option {
return func(wt *WebTTY) error {
wt.rows = rows
return nil
}
}