internal

package
v0.3.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidVersion = errors.New("invalid dasel version")
)
View Source
var (
	ErrMissingSnippet = errors.New("missing snippet")
)
View Source
var (
	ErrMissingSnippetID = errors.New("missing snippet id")
)

Functions

func NewHTTPService

func NewHTTPService(listenAddress string, executor *Executor, snippetStore storage.SnippetStore) *httpService

NewHTTPService returns a service that can be used to start a http server that will generate diagrams.

func StringToArgs added in v0.1.7

func StringToArgs(args string) ([]string, error)

StringToArgs converts the given string into a list of arguments.

Types

type ErrorResponse

type ErrorResponse struct {
	Error error `json:"error"`
}

func (ErrorResponse) MarshalJSON added in v0.1.0

func (r ErrorResponse) MarshalJSON() ([]byte, error)

type ExecuteArgs

type ExecuteArgs struct {
	Snippet *domain.Snippet
}

ExecuteArgs define the opts to use when executing dasel commands.

type ExecuteRequest

type ExecuteRequest struct {
	Snippet *domain.Snippet `json:"snippet"`
}

type ExecuteResponse

type ExecuteResponse struct {
	Data string `json:"data"`
}

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(snippetStore storage.SnippetStore) *Executor

NewExecutor returns an executor that can be used to run dasel commands.

func (*Executor) Execute

func (e *Executor) Execute(args ExecuteArgs) (result string, daselErr error, validationErr error, err error)

Execute executes a dasel command.

func (*Executor) RegisterVersion

func (e *Executor) RegisterVersion(v *VersionOpts)

func (*Executor) Versions

func (e *Executor) Versions() []string

Versions returns the set of available dasel versions.

type GetSnippetResponse added in v0.1.0

type GetSnippetResponse struct {
	Snippet *domain.Snippet `json:"snippet"`
}

type RestrictedArgErr added in v0.1.0

type RestrictedArgErr struct {
	Arg string
}

func (*RestrictedArgErr) Error added in v0.1.0

func (e *RestrictedArgErr) Error() string

type SaveSnippetRequest added in v0.1.0

type SaveSnippetRequest struct {
	Snippet *domain.Snippet `json:"snippet"`
}

type SaveSnippetResponse added in v0.1.0

type SaveSnippetResponse struct {
	Snippet *domain.Snippet `json:"snippet"`
}

type VersionOpts

type VersionOpts struct {
	Version string
	Path    string
}

VersionOpts defines options for a specific dasel version.

type VersionsResponse

type VersionsResponse struct {
	Versions []string `json:"versions"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL