Myzel394 ba056d6ae9
refactor(server): Improve Wireguard config; Improve the parser
Signed-off-by: Myzel394 <github.7a2op@simplelogin.co>
2025-03-16 00:23:54 +01:00

44 lines
686 B
Go

package ast
import (
"config-lsp/common"
)
type WGPropertyKey struct {
common.LocationRange
Name string
}
type WGPropertyValue struct {
common.LocationRange
Value string
}
type WGPropertySeparator struct {
common.LocationRange
}
type WGProperty struct {
Key WGPropertyKey
Separator *WGPropertySeparator
Value *WGPropertyValue
}
type WGHeader struct {
common.LocationRange
Name string
}
type WGSection struct {
common.LocationRange
Header WGHeader
// map of: line number -> WGProperty
Properties map[uint32]*WGProperty
}
type WGConfig struct {
Sections []*WGSection
// Used to identify where not to show diagnostics
CommentLines map[uint32]struct{}
}