odata

package
v0.0.0-...-6cd7eb2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedExpandParameters map[string][]string

SupportedExpandParameters contains a list of endpoints with their supported expand parameters

View Source
var SupportedSelectParameters map[string][]string

SupportedSelectParameters contains a list of endpoints with their supported select parameters

Functions

func IsValidOdataQuery

func IsValidOdataQuery(query string) bool

IsValidOdataQuery checks a querystring for containing correct keywords

Types

type GoDataCollectionCountQuery

type GoDataCollectionCountQuery bool

GoDataCollectionCountQuery true when addressing the count of a collection

type GoDataRefQuery

type GoDataRefQuery bool

GoDataRefQuery true when $ref is requested false if not

type GoDataValueQuery

type GoDataValueQuery bool

GoDataValueQuery true when $value is requested false if not

type QueryOptions

type QueryOptions struct {
	godata.GoDataQuery
	Value           *GoDataValueQuery
	Ref             *GoDataRefQuery
	CollectionCount *GoDataCollectionCountQuery
	RawExpand       string
	RawFilter       string
	RawOrderBy      string
}

QueryOptions extents upon godata.GoDataQuery to implement extra odata functions not found in the godata package

func ExpandItemToQueryOptions

func ExpandItemToQueryOptions(ei *godata.ExpandItem) *QueryOptions

ExpandItemToQueryOptions converts an ExpandItem into QueryOptions

func GetQueryOptions

func GetQueryOptions(r *http.Request, maxEntities int) (*QueryOptions, []error)

GetQueryOptions creates QueryOptions based upon the incoming request QueryOptions = nil when no query was found, errors != nil if something went wrong with parsing the query into QueryOptions and will contain information on what went wrong

func ParseURLQuery

func ParseURLQuery(query url.Values) (*QueryOptions, error)

ParseURLQuery parses an incoming url query into QueryOptions

func (*QueryOptions) ExpandParametersSupported

func (q *QueryOptions) ExpandParametersSupported(endpoint, expand string) bool

ExpandParametersSupported returns if the QueryOptions expand request is supported by the endpoints

func (*QueryOptions) SelectParametersSupported

func (q *QueryOptions) SelectParametersSupported(endpoint, selectString string) bool

SelectParametersSupported returns if the QueryOptions select request is supported by the endpoints

Jump to

Keyboard shortcuts

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