summaryrefslogtreecommitdiff
path: root/.config/nvim/snippets/eko.json
blob: 4845324a408c3d83fda5c3fc8d4b4bdb61612f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
  "dberr": {
    "body": "slog.ErrorContext(ctx, \"database error\", \"error\", err)",
    "prefix": "dberr",
    "scope": "go"
  },
  "serverapi": {
    "body": [
      "func $1(ctx context.Context, sess *session.Session, request *packet$0) packet.Payload {",
      "}"
    ],
    "prefix": "serverapi",
    "scope": "go"
  },
  "teamodel": {
    "body": [
      "import (",
      "\t\"fmt\"",
      "",
      "\ttea \"github.com/charmbracelet/bubbletea\"",
      ")",
      "",
      "type Model struct{",
      "    $0",
      "}",
      "",
      "func New() Model {",
      "\treturn Model",
      "    }",
      "}",
      "",
      "func (m Model) Init() tea.Cmd {",
      "\treturn nil",
      "}",
      "",
      "func (m Model) View() string {",
      "\treturn \"\"",
      "}",
      "",
      "func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {",
      "\tswitch msg := msg.(type) {",
      "\tdefault:",
      "\t\treturn m, nil",
      "\t}",
      "}"
    ],
    "prefix": "teamodel",
    "scope": "go"
  }
}