-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
53 lines (43 loc) · 1.09 KB
/
main.go
File metadata and controls
53 lines (43 loc) · 1.09 KB
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
51
52
53
//go:build wasip1
package main
import (
"context"
_ "embed"
pluginproto "github.com/gameap/gameap/pkg/plugin/proto"
"github.com/gameap/gameap/pkg/plugin/sdk"
)
//go:embed frontend/dist/plugin.js
var frontendBundle []byte
//go:embed frontend/dist/hex-editor-plugin.css
var frontendStyles []byte
func main() {}
func init() {
pluginproto.RegisterPluginService(&HexEditorPlugin{})
}
type HexEditorPlugin struct {
*sdk.EmptyPluginService
}
func (p *HexEditorPlugin) GetInfo(
_ context.Context,
_ *pluginproto.GetInfoRequest,
) (*pluginproto.PluginInfo, error) {
return &pluginproto.PluginInfo{
Id: "hexeditor4jm2",
Name: "Hex Editor",
Version: "1.0.0",
Description: "View and edit files in hexadecimal format",
Author: "GameAP",
ApiVersion: "1",
}, nil
}
func (p *HexEditorPlugin) GetFrontendBundle(
_ context.Context,
_ *pluginproto.GetFrontendBundleRequest,
) (*pluginproto.GetFrontendBundleResponse, error) {
return &pluginproto.GetFrontendBundleResponse{
HasBundle: true,
Bundle: frontendBundle,
HasStyles: true,
Styles: frontendStyles,
}, nil
}