Documentation
¶
Index ¶
- type Direction
- type Order
- type Query
- func (o *Query[V]) Count() *Query[V]
- func (o *Query[V]) Expand(keys ...string) *Query[V]
- func (o *Query[V]) Filter(filter string) *Query[V]
- func (o *Query[V]) Get() (*V, error)
- func (o *Query[V]) GetAll() ([]V, error)
- func (o *Query[V]) OrderBy(key string, direction ...Direction) *Query[V]
- func (o *Query[V]) PathParam(key, value string) *Query[V]
- func (o *Query[V]) Search(query string) *Query[V]
- func (o *Query[V]) Select(keys ...string) *Query[V]
- func (o *Query[V]) Skip(num uint64) *Query[V]
- func (o *Query[V]) Top(num uint64) *Query[V]
- type RequestError
- type RequestProvider
- type Respose
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Query ¶
type Query[V any] struct { // contains filtered or unexported fields }
Query is a builder type for an OData query
func NewQuery ¶
func NewQuery[V any](client RequestProvider, url string) *Query[V]
NewQuery creates a new OData query for a specific URL that will be resolved with the provided RequestProvider
func (*Query[V]) GetAll ¶
GetAll performs an OData request for a set of items, iterating through all pages and collecting the results
type RequestError ¶
func (*RequestError) Error ¶
func (r *RequestError) Error() string
type RequestProvider ¶
type RequestProvider interface {
NewRequest() (*resty.Request, error)
}
RequestProviders generate Resty requests that already contain a base URL and the necessary authentication information for the OData API
type Respose ¶
type Respose[V any] struct { Context string `json:"@odata.context"` Count uint64 `json:"@odata.count"` Next string `json:"@odata.nextLink"` Value []V `json:"value"` }
func (*Respose[V]) Collect ¶
func (o *Respose[V]) Collect(c RequestProvider) error
Collect iterates through pages of OData results and collects them into the original result
Click to show internal directories.
Click to hide internal directories.