nerdgraph

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindKeyValue

func FindKeyValue(data []byte, key string) (value interface{}, err error)

func HasErrors

func HasErrors(e model.ErrorHandler, data *[]byte) (err error)

HasErrors can't be a method on ErrorHandler due to the way Go handles (or doesn't) dispatch- no v-table :-(

func NewClient

func NewClient(config *configuration.Config, errorHandler model.ErrorHandler, resultHandler model.ResultHandler) *nerdgraph

func NewCommonErrorHandler

func NewCommonErrorHandler(m model.Model) (eh model.ErrorHandler)

func NewResultHandler

func NewResultHandler() (h model.ResultHandler)

Types

type CommonErrorHandler

type CommonErrorHandler struct {
	M model.Model
}

CommonErrorHandler implements ErrorHandler and provides a common, default, implementation of dealing with errors coming out of API calls.

func (*CommonErrorHandler) GetErrorMap

func (e *CommonErrorHandler) GetErrorMap(v interface{}, result map[string]interface{})

func (*CommonErrorHandler) ServerError

func (e *CommonErrorHandler) ServerError(data *[]byte, s string) (err error)

ServerError is relatively simple, we know its shape

func (*CommonErrorHandler) TypeSpecificError

func (e *CommonErrorHandler) TypeSpecificError(data *[]byte, s string) (err error)

TypeSpecificError is a bit complex, we don't know the shape so we have to travel a map[string]interface{}

type ResultHandler

type ResultHandler struct {
}

func (ResultHandler) Create

func (n ResultHandler) Create(m model.Model, body []byte) (err error)

func (ResultHandler) Delete

func (n ResultHandler) Delete(m model.Model, body []byte) (err error)

func (ResultHandler) List

func (n ResultHandler) List(m model.Model, body []byte) (err error)

func (ResultHandler) Read

func (n ResultHandler) Read(m model.Model, body []byte) (err error)

func (ResultHandler) Update

func (n ResultHandler) Update(m model.Model, body []byte) (err error)

Jump to

Keyboard shortcuts

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