remote

package
v0.0.0-...-c2f0dd3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBody

func DecodeBody(w http.ResponseWriter, r *http.Request, body interface{}) (err error)

use to decode a body for read access command (cat & ls & tree)

func DecodeJSONBody

func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) error

Use to mitigate the Decoder limitation (error handling ,etc)

func SendReadRequest

func SendReadRequest(darkenresourceName string, endpoint string) string

Create a request for a read command (cat or ls or tree) and return the response body Errors are handled in the function

func SendWriteRequest

func SendWriteRequest(patch string, endpoint string) string

Create a request for a write command (eg rm) and return the response body the body is a patch in json format which tells to ubac which ressource modified, removed or add Errors are handled in the function

Types

type BodyRead

type BodyRead struct {
	ResourceName string `json:"name"`
}

func CreateBodyRead

func CreateBodyRead(resourceName string) BodyRead

type BodyWrite

type BodyWrite struct {
	Patch string `json: "patch"`
}

func CreateBodyWrite

func CreateBodyWrite(patch string) BodyWrite

type MalformedRequest

type MalformedRequest struct {
	Status int
	Msg    string
}

func (*MalformedRequest) Error

func (mr *MalformedRequest) Error() string

Jump to

Keyboard shortcuts

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