Documentation
¶
Index ¶
- func ReadDocument(u uri.URI) (contents []byte, err error)
- type BakeHCLDocument
- type BakePrintOutput
- type ComposeDocument
- type DockerfileDocument
- type Document
- type DocumentMap
- type Manager
- func (m *Manager) Get(ctx context.Context, u uri.URI) Document
- func (m *Manager) Keys() []uri.URI
- func (m *Manager) LockDocument(uri uri.URI) bool
- func (m *Manager) Overwrite(ctx context.Context, u uri.URI, version int32, input []byte) (bool, error)
- func (m *Manager) Queue(ctx context.Context, u uri.URI, fn func())
- func (m *Manager) Read(ctx context.Context, u uri.URI) (doc Document, err error)
- func (m *Manager) Remove(u uri.URI)
- func (m *Manager) UnlockDocument(uri uri.URI)
- func (m *Manager) Version(ctx context.Context, u uri.URI) (int32, error)
- func (m *Manager) Write(ctx context.Context, u uri.URI, identifier protocol.LanguageIdentifier, ...) (bool, error)
- type ManagerOpt
- type NewDocumentFunc
- type ReadDocumentFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BakeHCLDocument ¶
type BakeHCLDocument interface { Document Decoder() *decoder.PathDecoder File() *hcl.File DockerfileForTarget(block *hclsyntax.Block) (string, error) }
func NewBakeHCLDocument ¶
func NewBakeHCLDocument(u uri.URI, version int32, input []byte) BakeHCLDocument
type BakePrintOutput ¶ added in v0.3.6
type ComposeDocument ¶
type ComposeDocument interface { Document RootNode() yaml.Node }
func NewComposeDocument ¶
func NewComposeDocument(u uri.URI, version int32, input []byte) ComposeDocument
type DockerfileDocument ¶
type DockerfileDocument interface { Document Instruction(p protocol.Position) *parser.Node Nodes() []*parser.Node }
func NewDockerfileDocument ¶
func NewDockerfileDocument(u uri.URI, version int32, input []byte) DockerfileDocument
type Document ¶
type Document interface { URI() uri.URI Copy() Document Input() []byte Version() int32 Update(version int32, input []byte) bool Close() LanguageIdentifier() protocol.LanguageIdentifier }
func NewDocument ¶
type DocumentMap ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager provides simplified file read/write operations for the LSP server.
func NewDocumentManager ¶
func NewDocumentManager(opts ...ManagerOpt) *Manager
func (*Manager) LockDocument ¶ added in v0.3.0
LockDocument locks the specified document in preparation of publishing diagnostics. False may be returned if the document is not recognized as being opened in the client.
func (*Manager) Queue ¶ added in v0.3.0
Queue enqueues the given function as something that should be run in the near future. The URI will be used as a key so if another function had previously enqueued for this function and it had not yet been run that the previously enqueued function will be discarded and replaced with the provided function.
func (*Manager) Read ¶
Read returns the contents of the file for the given URI.
If no file exists at the path or the URI is of an invalid type, an error is returned.
func (*Manager) UnlockDocument ¶ added in v0.3.0
type ManagerOpt ¶
type ManagerOpt func(manager *Manager)
func WithReadDocumentFunc ¶
func WithReadDocumentFunc(readDocFunc ReadDocumentFunc) ManagerOpt