data_service

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLinkByRel

func GetLinkByRel(rel string, links []base.Link) string

func GetLinkMap

func GetLinkMap(links []base.Link) map[string]string

func GetLinkedObjectName

func GetLinkedObjectName(rel string, links []base.Link) string

Types

type DataServiceClient

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

func NewClient

func NewClient(url string, token string, serviceName string) *DataServiceClient

func NewCustomClient

func NewCustomClient(url string, token string, serviceName string, httpClient *http.Client) *DataServiceClient

func (*DataServiceClient) DelHeader

func (c *DataServiceClient) DelHeader(key string)

func (*DataServiceClient) Delete

func (c *DataServiceClient) Delete(resource string) (*http.Response, error)

func (*DataServiceClient) DeleteWithContext

func (c *DataServiceClient) DeleteWithContext(ctx context.Context, resource string) (*http.Response, error)

DeleteWithContext performs a DELETE request with context support.

func (*DataServiceClient) Do

func (c *DataServiceClient) Do(request *http.Request, responseBodyOut any) (*http.Response, error)

func (*DataServiceClient) Get

func (c *DataServiceClient) Get(resource string, responseBodyOut any) (*http.Response, error)

func (*DataServiceClient) GetHeader

func (c *DataServiceClient) GetHeader(key string) string

func (*DataServiceClient) GetWithContext

func (c *DataServiceClient) GetWithContext(ctx context.Context, resource string, responseBodyOut any) (*http.Response, error)

GetWithContext performs a GET request with context support.

func (*DataServiceClient) Options

func (c *DataServiceClient) Options(resource string) (*http.Response, error)

func (*DataServiceClient) Patch

func (c *DataServiceClient) Patch(resource string, requestBody string, responseBodyOut any) (*http.Response, error)

func (*DataServiceClient) PatchJSONWithContext

func (c *DataServiceClient) PatchJSONWithContext(ctx context.Context, resource string, body any, responseBodyOut any) (*http.Response, error)

PatchJSONWithContext marshals body to JSON and performs PATCH with context.

func (*DataServiceClient) PatchWithContext

func (c *DataServiceClient) PatchWithContext(ctx context.Context, resource string, requestBody string, responseBodyOut any) (*http.Response, error)

PatchWithContext performs a PATCH request with context support.

func (*DataServiceClient) Post

func (c *DataServiceClient) Post(resource string, requestBody string, responseBodyOut any) (*http.Response, error)

func (*DataServiceClient) PostJSONWithContext

func (c *DataServiceClient) PostJSONWithContext(ctx context.Context, resource string, body any, responseBodyOut any) (*http.Response, error)

PostJSONWithContext marshals body to JSON and performs POST with context.

func (*DataServiceClient) PostWithContext

func (c *DataServiceClient) PostWithContext(ctx context.Context, resource string, requestBody string, responseBodyOut any) (*http.Response, error)

PostWithContext performs a POST request with context support.

func (*DataServiceClient) Put

func (c *DataServiceClient) Put(resource string, requestBody string, responseBodyOut any) (*http.Response, error)

func (*DataServiceClient) PutJSONWithContext

func (c *DataServiceClient) PutJSONWithContext(ctx context.Context, resource string, body any, responseBodyOut any) (*http.Response, error)

PutJSONWithContext marshals body to JSON and performs PUT with context.

func (*DataServiceClient) PutWithContext

func (c *DataServiceClient) PutWithContext(ctx context.Context, resource string, requestBody string, responseBodyOut any) (*http.Response, error)

PutWithContext performs a PUT request with context support.

func (*DataServiceClient) Request

func (c *DataServiceClient) Request(method string, resource string, requestBody string) (*http.Request, error)

func (*DataServiceClient) RequestWithContext

func (c *DataServiceClient) RequestWithContext(ctx context.Context, method string, resource string, requestBody string) (*http.Request, error)

RequestWithContext creates a request with context support.

func (*DataServiceClient) SetHeader

func (c *DataServiceClient) SetHeader(key string, value string)

func (*DataServiceClient) SetToken

func (c *DataServiceClient) SetToken(token string)

type ListIterator

type ListIterator[T any] struct {
	// contains filtered or unexported fields
}

func NewListIterator

func NewListIterator[T any](client *DataServiceClient, url string) *ListIterator[T]

func (*ListIterator[T]) Error

func (i *ListIterator[T]) Error() error

func (*ListIterator[T]) Item

func (i *ListIterator[T]) Item() T

func (*ListIterator[T]) List

func (i *ListIterator[T]) List() ([]T, error)

func (*ListIterator[T]) Next

func (i *ListIterator[T]) Next() bool

func (*ListIterator[T]) VisitAll

func (i *ListIterator[T]) VisitAll(handler func(t T) error) ([]T, error)

Jump to

Keyboard shortcuts

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