odataClient

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ODataClient

type ODataClient interface {
	Wrapper
	AddHeader(key string, value string)
}

ODataClient represents a connection to the OData REST API

func New

func New(baseUrl string) ODataClient

type ODataDataSet

type ODataDataSet[ModelT any, Def ODataModelDefinition[ModelT]] interface {
	Single(id string) (ModelT, error)
	List(filter ODataFilter) (<-chan ModelT, <-chan error)
	Insert(model ModelT) (ModelT, error)
	Update(id string, model ModelT) (ModelT, error)
	Delete(id string) error
	// contains filtered or unexported methods
}

func NewDataSet

func NewDataSet[ModelT any, Def ODataModelDefinition[ModelT]](client ODataClient, modelDefinition Def) ODataDataSet[ModelT, Def]

type ODataFilter

type ODataFilter struct {
	Filter string
}

ODataFilter represents a OData Filter query

type ODataModelCollection

type ODataModelCollection[T any] interface {
	ODataModelDefinition[T]
	DataSet() ODataDataSet[T, ODataModelDefinition[T]]
}

type ODataModelDefinition

type ODataModelDefinition[T any] interface {
	Name() string
	Url() string
}

type Wrapper added in v0.0.4

type Wrapper interface {
	ODataClient() ODataClient
}

Wrapper represents a wrapper around the OData client if you have build own code around the OData itself, for authentication etc

Jump to

Keyboard shortcuts

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