response

package
v0.0.0-...-8419b15 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: ISC Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendErrorAndExit

func SendErrorAndExit(errorCode errors.Code, params *map[errors.Field]string)

SendErrorAndExit sends an error response to the browser extension in the predefined json format and exits with the specified exit code

func SendOk

func SendOk(data interface{})

SendOk sends a success response to the browser extension in the predefined json format

func SendRaw

func SendRaw(response interface{})

SendRaw sends a raw data to the browser extension

Types

type ConfigureResponse

type ConfigureResponse struct {
	DefaultStore struct {
		Path     string `json:"path"`
		Settings string `json:"settings"`
	} `json:"defaultStore"`
	StoreSettings map[string]string `json:"storeSettings"`
}

ConfigureResponse a response format for the "configure" request

func MakeConfigureResponse

func MakeConfigureResponse() *ConfigureResponse

MakeConfigureResponse initializes an empty configure response

type DeleteResponse

type DeleteResponse struct {
}

DeleteResponse a response format for the "delete" request

func MakeDeleteResponse

func MakeDeleteResponse() *DeleteResponse

MakeDeleteResponse initializes an empty delete response

type FetchResponse

type FetchResponse struct {
	Contents string `json:"contents"`
}

FetchResponse a response format for the "fetch" request

func MakeFetchResponse

func MakeFetchResponse() *FetchResponse

MakeFetchResponse initializes an empty fetch response

type ListResponse

type ListResponse struct {
	Files map[string][]string `json:"files"`
}

ListResponse a response format for the "list" request

func MakeListResponse

func MakeListResponse() *ListResponse

MakeListResponse initializes an empty list response

type SaveResponse

type SaveResponse struct {
}

SaveResponse a response format for the "save" request

func MakeSaveResponse

func MakeSaveResponse() *SaveResponse

MakeSaveResponse initializes an empty save response

type TreeResponse

type TreeResponse struct {
	Directories map[string][]string `json:"directories"`
}

TreeResponse a response format for the "tree" request

func MakeTreeResponse

func MakeTreeResponse() *TreeResponse

MakeTreeResponse initializes an empty tree response

Jump to

Keyboard shortcuts

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