mirror of
https://github.com/yudai/gotty.git
synced 2026-02-10 02:14:21 +01:00
Refine API of webtty package
This commit is contained in:
parent
d1ec7125cf
commit
807bcc25a4
10 changed files with 82 additions and 97 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue