Skip to content

Commit bb2da60

Browse files
committed
Add tmuxp config struct
1 parent b5ecf01 commit bb2da60

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

pkg/tmuxp/tmuxp.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package tmuxp
2+
3+
import "io"
4+
5+
// Window represents a window in a tmux session
6+
type Window struct {
7+
Name string
8+
Panes []struct{}
9+
}
10+
11+
// Windows represents a list of windows in a tmux session
12+
type Windows []Window
13+
14+
// Environment represents env variables to be loaded in a tmux session
15+
type Environment map[string]string
16+
17+
// Config represents tmuxp config
18+
type Config struct {
19+
SessionName string
20+
Windows
21+
Environment
22+
writer io.Writer
23+
}
24+
25+
// New returns a new tmuxp config
26+
func New(writer io.Writer) Config {
27+
return Config{
28+
writer: writer,
29+
}
30+
}

pkg/tmuxp/tmuxp_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package tmuxp_test
2+
3+
import (
4+
"io"
5+
"testing"
6+
7+
"github.com/arunvelsriram/kube-tmuxp/pkg/tmuxp"
8+
"github.com/stretchr/testify/assert"
9+
)
10+
11+
func TestNew(t *testing.T) {
12+
var writer io.Writer
13+
tmuxpCfg := tmuxp.New(writer)
14+
15+
assert.NotNil(t, tmuxpCfg)
16+
}

0 commit comments

Comments
 (0)