odata

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const JSTimeFormat = "2006-01-02T15:04:05Z0700"
View Source
const OneCTimeFormat = "2006-01-02T15:04:05"

Variables

This section is empty.

Functions

func ConvertType

func ConvertType(in interface{}, out interface{}) error

Type converter for any types through conversion to JSON and back

Types

type Binary

type Binary string

Type for Edm.Binary

func (Binary) AsParameter

func (t Binary) AsParameter() string

A custom marshaller to uri query format

func (Binary) ImplementsGraphQLType

func (Binary) ImplementsGraphQLType(name string) bool

Maps this Go type to the graphql scalar type in the schema.

func (*Binary) UnmarshalGraphQL

func (t *Binary) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaller for Binary type

type Boolean

type Boolean bool

Type for Edm.Boolean

func (Boolean) AsParameter

func (t Boolean) AsParameter() string

A custom marshaller to uri query format for Boolean type

func (Boolean) ImplementsGraphQLType

func (Boolean) ImplementsGraphQLType(name string) bool

Maps Boolean to the graphql scalar type in the schema.

func (Boolean) MarshalJSON

func (t Boolean) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Boolean type

func (*Boolean) UnmarshalGraphQL

func (t *Boolean) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaller for Boolean type

func (*Boolean) UnmarshalJSON

func (t *Boolean) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Boolean type

type Client

type Client struct {
	PoolSize int
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username, password, endpoint string, poolSize, queueSize int, transport http.RoundTripper) *Client

Return initialized odata client

func (*Client) Close

func (c *Client) Close()

func (*Client) ExecuteEntityMethod

func (c *Client) ExecuteEntityMethod(key IPrimaryKey, function IFunction) ([]byte, error)

Execute entity's method and return its output in json

func (*Client) GetEntityNavigaion

func (c *Client) GetEntityNavigaion(key IPrimaryKey, property string) ([]byte, error)

Returns json representation of entity's NavigationProperty

type DateTime

type DateTime time.Time

Type for Edm.DateTime

func (DateTime) AsParameter

func (t DateTime) AsParameter() string

A custom marshaller to uri query format for DateTime type

func (DateTime) ImplementsGraphQLType

func (DateTime) ImplementsGraphQLType(name string) bool

Maps DateTime to the graphql scalar type in the schema.

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for DateTime type

func (*DateTime) UnmarshalGraphQL

func (t *DateTime) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaler for DateTime type

func (*DateTime) UnmarshalJSON

func (t *DateTime) UnmarshalJSON(b []byte) error

A custom json unmarshaller for DateTime type

type Double

type Double float64

Type for Edm.Double

func (Double) AsParameter

func (t Double) AsParameter() string

A custom marshaller to uri query format for Double type

func (Double) ImplementsGraphQLType

func (Double) ImplementsGraphQLType(name string) bool

Maps Double to the graphql scalar type in the schema.

func (Double) MarshalJSON

func (t Double) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Double type

func (*Double) UnmarshalGraphQL

func (t *Double) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaler for Double type

func (*Double) UnmarshalJSON

func (t *Double) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Double type

type Error

type Error struct {
	Code    string `json:"code"`
	Message struct {
		Lang  string `json:"lang"`
		Value string `json:"value"`
	} `json:"message"`
	HttpCode int `json:"http_code"`
}

func (Error) Error

func (err Error) Error() string

func (Error) Extensions

func (err Error) Extensions() map[string]interface{}

type ErrorResponse

type ErrorResponse struct {
	Error `json:"odata.error"`
}

type Float

type Float float64

Type for Edm.Float

func (Float) AsParameter

func (t Float) AsParameter() string

A custom marshaller to uri query format for Float type

func (Float) ImplementsGraphQLType

func (Float) ImplementsGraphQLType(name string) bool

Maps Float to the graphql scalar type in the schema.

func (Float) MarshalJSON

func (t Float) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Float type

func (*Float) UnmarshalGraphQL

func (t *Float) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaler for Float type

func (*Float) UnmarshalJSON

func (t *Float) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Float type

type Guid

type Guid string

Type for Edm.Guid

func (Guid) AsParameter

func (t Guid) AsParameter() string

A custom marshaller to uri query format for Guid type

func (Guid) ImplementsGraphQLType

func (Guid) ImplementsGraphQLType(name string) bool

Maps Guid to the graphql scalar type in the schema.

func (Guid) MarshalJSON

func (t Guid) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Guid type

func (*Guid) UnmarshalGraphQL

func (t *Guid) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for Guid type

func (*Guid) UnmarshalJSON

func (t *Guid) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Guid type

type IEntity

type IEntity interface {
	APIEntityType() string
}

Interface for odata Entity type

type IFilter

type IFilter interface {
	ToString() string
}

Interface for odata Filter type

type IFunction

type IFunction interface {
	Name() string
	Parameters() string
}

Interface for odata Function type

type IPrimaryKey

type IPrimaryKey interface {
	APIEntityType() string
	Serialize() string
}

Interface for odata PrimaryKey type

type Int

type Int int

Type for Edm.Int

func (Int) AsParameter

func (t Int) AsParameter() string

A custom marshaller to uri query format for Int type

func (Int) ImplementsGraphQLType

func (Int) ImplementsGraphQLType(name string) bool

Maps Int to the graphql scalar type in the schema.

func (Int) MarshalJSON

func (t Int) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Int type

func (*Int) UnmarshalGraphQL

func (t *Int) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for Int type

func (*Int) UnmarshalJSON

func (t *Int) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Int type

type Int16

type Int16 int16

Type for Edm.Int16

func (Int16) AsParameter

func (t Int16) AsParameter() string

A custom marshaller to uri query format for Int16 type

func (Int16) ImplementsGraphQLType

func (Int16) ImplementsGraphQLType(name string) bool

Maps Int to the graphql scalar type in the schema.

func (Int16) MarshalJSON

func (t Int16) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Int16 type

func (*Int16) UnmarshalGraphQL

func (t *Int16) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for Int16 type

func (*Int16) UnmarshalJSON

func (t *Int16) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Int16 type

type Int64

type Int64 int64

Type for Edm.Int64

func (Int64) AsParameter

func (t Int64) AsParameter() string

A custom marshaller to uri query format for Int64 type

func (Int64) ImplementsGraphQLType

func (Int64) ImplementsGraphQLType(name string) bool

Maps Int64 to the graphql scalar type in the schema.

func (Int64) MarshalJSON

func (t Int64) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Int64 type

func (*Int64) UnmarshalGraphQL

func (t *Int64) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for Int64 type

func (*Int64) UnmarshalJSON

func (t *Int64) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Int64 type

type Request

type Request struct {
	// contains filtered or unexported fields
}

type Stream

type Stream string

Type for Edm.Stream

func (Stream) AsParameter

func (t Stream) AsParameter() string

A custom marshaller to uri query format

func (Stream) ImplementsGraphQLType

func (Stream) ImplementsGraphQLType(name string) bool

Maps this Go type to the graphql scalar type in the schema.

func (*Stream) UnmarshalGraphQL

func (t *Stream) UnmarshalGraphQL(input interface{}) error

A custom graphql unmarshaller for Binary type

type String

type String string

Type for Edm.String

func (String) AsParameter

func (t String) AsParameter() string

A custom marshaller to uri query format for String type

func (String) Escape

func (t String) Escape() string

Escape quotes

func (String) ImplementsGraphQLType

func (String) ImplementsGraphQLType(name string) bool

Maps String to the graphql scalar type in the schema.

func (String) MarshalJSON

func (t String) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for String type

func (*String) UnmarshalGraphQL

func (t *String) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for String type

func (*String) UnmarshalJSON

func (t *String) UnmarshalJSON(b []byte) error

A custom json unmarshaller for String type

type Time

type Time time.Time

Type for Edm.Time

func (Time) AsParameter

func (t Time) AsParameter() string

A custom marshaller to uri query format for Time type

func (Time) ImplementsGraphQLType

func (Time) ImplementsGraphQLType(name string) bool

Maps Time to the graphql scalar type in the schema.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

A custom json/graphql marshaller for Time type

func (*Time) UnmarshalGraphQL

func (t *Time) UnmarshalGraphQL(input interface{}) error

A custom unmarshaler for Time type

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

A custom json unmarshaller for Time type

type Where

type Where struct {
	Top     int32
	Skip    int32
	Filter  IFilter
	Orderby string
	Fields  []string
}

func (*Where) Serialize

func (w *Where) Serialize() string

Returns string representation of Where object

Jump to

Keyboard shortcuts

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