sdk

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 13 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(topicAPIURL string) *Client

New creates a new instance of Client with a given topic api url

func NewWithHealthClient

func NewWithHealthClient(hcCli *healthcheck.Client) *Client

NewWithHealthClient creates a new instance of topic API Client, reusing the URL and Clienter from the provided healthcheck client

func (*Client) Checker

func (cli *Client) Checker(ctx context.Context, check *health.CheckState) error

Checker calls topic api health endpoint and returns a check object to the caller

func (*Client) GetRootTopicsPrivate

func (cli *Client) GetRootTopicsPrivate(ctx context.Context, reqHeaders Headers) (*models.PrivateSubtopics, error)

GetRootTopicsPrivate gets the private list of top level root topics for Publishing which returns both Next and Current document(s) in the response

func (*Client) GetRootTopicsPublic

func (cli *Client) GetRootTopicsPublic(ctx context.Context, reqHeaders Headers) (*models.PublicSubtopics, error)

GetRootTopicsPublic gets the public list of top level root topics for Web which returns the Current document(s) in the response

func (*Client) GetSubtopicsPrivate

func (cli *Client) GetSubtopicsPrivate(ctx context.Context, reqHeaders Headers, id string) (*models.PrivateSubtopics, error)

GetSubtopicsPrivate gets the private list of subtopics of a topic for Publishing which returns both Next and Current document(s) in the response

func (*Client) GetSubtopicsPublic

func (cli *Client) GetSubtopicsPublic(ctx context.Context, reqHeaders Headers, id string) (*models.PublicSubtopics, error)

GetSubtopicsPublic gets the public list of subtopics of a topic for Web which returns the Current document(s) in the response

func (*Client) Health

func (cli *Client) Health() *healthcheck.Client

Health returns the underlying Healthcheck Client for this topic API client

func (*Client) URL

func (cli *Client) URL() string

URL returns the URL used by this client

type Clienter

type Clienter interface {
	Checker(ctx context.Context, check *health.CheckState) error
	GetRootTopicsPrivate(ctx context.Context, reqHeaders Headers) (*models.PrivateSubtopics, error)
	GetRootTopicsPublic(ctx context.Context, reqHeaders Headers) (*models.PublicSubtopics, error)
	GetSubtopicsPrivate(ctx context.Context, reqHeaders Headers, id string) (*models.PrivateSubtopics, error)
	GetSubtopicsPublic(ctx context.Context, reqHeaders Headers, id string) (*models.PublicSubtopics, error)
	Health() *healthcheck.Client
	URL() string
}

type Headers

type Headers struct {
	ServiceAuthToken string
	UserAuthToken    string
}

func (*Headers) Add

func (h *Headers) Add(req *http.Request) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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