discovery

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package discovery provides support the HSDP Discovery services

Index

Constants

View Source
const (
	APIVersion = "1"
)

Variables

View Source
var (
	ErrBaseURLCannotBeEmpty = errors.New("base URL cannot be empty")
	ErrEmptyResult          = errors.New("empty result")
	ErrInvalidEndpointURL   = errors.New("invalid endpoint URL")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// HTTP Client used to communicate with IAM API
	*iam.Client

	// User agent used when communicating with the HSDP Notification API
	UserAgent string
	// contains filtered or unexported fields
}

A Client manages communication with HSDP AI APIs

func NewClient

func NewClient(iamClient *iam.Client, config *Config) (*Client, error)

NewClient returns a new Connect base Client

func (*Client) Close

func (c *Client) Close()

Close releases allocated resources of clients

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

Do executes a http request. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

func (*Client) GetBaseURL

func (c *Client) GetBaseURL() string

GetBaseURL returns the base URL as configured

func (*Client) GetEndpointURL

func (c *Client) GetEndpointURL() string

GetEndpointURL returns the FHIR Store Endpoint URL as configured

func (*Client) GetServices

func (c *Client) GetServices() (*[]Service, *Response, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method, requestPath string, opt interface{}, options ...OptionFunc) (*http.Request, error)

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(urlStr string) error

SetBaseURL sets the base URL for API requests

type Config

type Config struct {
	Region      string
	Environment string
	BaseURL     string
	DebugLog    io.Writer
	Retry       int
}

Config contains the configuration of a Client

type OptionFunc

type OptionFunc func(*http.Request) error

OptionFunc is the function signature function for options

type Response

type Response struct {
	*http.Response
}

Response is a HSDP IAM API response. This wraps the standard http.Response returned from HSDP IAM and provides convenient access to things like errors

func (*Response) StatusCode added in v0.73.0

func (r *Response) StatusCode() int

type Service

type Service struct {
	ResourceType string   `json:"resourceType"`
	ID           string   `json:"id"`
	Name         string   `json:"name"`
	Tag          string   `json:"tag"`
	Actions      []string `json:"actions"`
	IsTrusted    bool     `json:"isTrusted"`
	URLS         []string `json:"urls"`
}

Service describes a discovered service

Jump to

Keyboard shortcuts

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