service

package
v0.1.49 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 11 Imported by: 25

Documentation

Index

Constants

View Source
const (
	HeaderKey string = "aischylos"

	QuizType string = "quizType"
)

Variables

This section is empty.

Functions

func Health

func Health(path url.URL, client HttpClient, uuid string) (*http.Response, error)

Types

type Alexandros

type Alexandros interface {
	Health(uuid string) (*http.Response, error)
	Search(word, language, mode, textSearch, uuid string) (*http.Response, error)
}

type AlexandrosImpl

type AlexandrosImpl struct {
	Scheme  string
	BaseUrl string
	Client  HttpClient
}

func NewAlexnadrosConfig

func NewAlexnadrosConfig(schema OdysseiaApi, ca []byte) (*AlexandrosImpl, error)

func NewFakeAlexandrosConfig

func NewFakeAlexandrosConfig(scheme, baseUrl string, client HttpClient) (*AlexandrosImpl, error)

func (*AlexandrosImpl) Health

func (a *AlexandrosImpl) Health(uuid string) (*http.Response, error)

func (*AlexandrosImpl) Search

func (a *AlexandrosImpl) Search(word, language, mode, textSearch, uuid string) (*http.Response, error)

type ClientConfig

type ClientConfig struct {
	Ca         []byte
	Solon      OdysseiaApi
	Ptolemaios OdysseiaApi
	Herodotos  OdysseiaApi
	Dionysios  OdysseiaApi
	Alexandros OdysseiaApi
	Sokrates   OdysseiaApi
}

type ClientImpl

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

func (*ClientImpl) Get

func (c *ClientImpl) Get(u *url.URL, uuid string) (*http.Response, error)

func (*ClientImpl) Post

func (c *ClientImpl) Post(u *url.URL, body []byte, uuid string) (*http.Response, error)

type Dionysios

type Dionysios interface {
	Health(uuid string) (*http.Response, error)
	Grammar(word string, uuid string) (*http.Response, error)
}

type DionysiosImpl

type DionysiosImpl struct {
	Scheme  string
	BaseUrl string
	Client  HttpClient
}

func NewDionysiosConfig

func NewDionysiosConfig(schema OdysseiaApi, ca []byte) (*DionysiosImpl, error)

func NewFakeDionysiosConfig

func NewFakeDionysiosConfig(scheme, baseUrl string, client HttpClient) (*DionysiosImpl, error)

func (*DionysiosImpl) Grammar

func (d *DionysiosImpl) Grammar(word string, uuid string) (*http.Response, error)

func (*DionysiosImpl) Health

func (d *DionysiosImpl) Health(uuid string) (*http.Response, error)

type FakeClientImpl

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

func (*FakeClientImpl) Get

func (f *FakeClientImpl) Get(u *url.URL, uuid string) (*http.Response, error)

func (*FakeClientImpl) Post

func (f *FakeClientImpl) Post(u *url.URL, body []byte, uuid string) (*http.Response, error)

type Herodotos

type Herodotos interface {
	Health(uuid string) (*http.Response, error)
	Create(body []byte, uuid string) (*http.Response, error)
	Analyze(body []byte, uuid string) (*http.Response, error)
	Check(body []byte, uuid string) (*http.Response, error)
	Options(uuid string) (*http.Response, error)
}

type HerodotosImpl

type HerodotosImpl struct {
	Scheme  string
	BaseUrl string
	Client  HttpClient
}

func NewFakeHerodotosConfig

func NewFakeHerodotosConfig(scheme, baseUrl string, client HttpClient) (*HerodotosImpl, error)

func NewHerodotosConfig

func NewHerodotosConfig(schema OdysseiaApi, ca []byte) (*HerodotosImpl, error)

func (*HerodotosImpl) Analyze added in v0.1.20

func (h *HerodotosImpl) Analyze(body []byte, uuid string) (*http.Response, error)

func (*HerodotosImpl) Check added in v0.1.20

func (h *HerodotosImpl) Check(body []byte, uuid string) (*http.Response, error)

func (*HerodotosImpl) Create added in v0.1.20

func (h *HerodotosImpl) Create(body []byte, uuid string) (*http.Response, error)

func (*HerodotosImpl) Health

func (h *HerodotosImpl) Health(uuid string) (*http.Response, error)

func (*HerodotosImpl) Options added in v0.1.20

func (h *HerodotosImpl) Options(uuid string) (*http.Response, error)

type HttpClient

type HttpClient interface {
	Get(u *url.URL, uuid string) (*http.Response, error)
	Post(u *url.URL, body []byte, uuid string) (*http.Response, error)
}

func NewFakeHttpClient

func NewFakeHttpClient(responseBodies []string, codes []int) HttpClient

func NewHttpClient

func NewHttpClient(caCert []byte, certs []tls.Certificate) HttpClient

type Odysseia

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

func (*Odysseia) Alexandros

func (o *Odysseia) Alexandros() Alexandros

func (*Odysseia) Dionysios

func (o *Odysseia) Dionysios() Dionysios

func (*Odysseia) Herodotos

func (o *Odysseia) Herodotos() Herodotos

func (*Odysseia) Sokrates

func (o *Odysseia) Sokrates() Sokrates

func (*Odysseia) Solon

func (o *Odysseia) Solon() Solon

type OdysseiaApi

type OdysseiaApi struct {
	Url    string
	Scheme string
	Cert   []tls.Certificate
}

type OdysseiaClient

type OdysseiaClient interface {
	Solon() Solon
	Herodotos() Herodotos
	Alexandros() Alexandros
	Sokrates() Sokrates
	Dionysios() Dionysios
}

func NewClient

func NewClient(config ClientConfig) (OdysseiaClient, error)

func NewFakeClient

func NewFakeClient(config ClientConfig, codes []int, responses []string) (OdysseiaClient, error)

type Sokrates

type Sokrates interface {
	Health(uuid string) (*http.Response, error)
	Create(body []byte, uuid string) (*http.Response, error)
	Check(body []byte, uuid string) (*http.Response, error)
	Options(quizType string, requestID string) (*http.Response, error)
}

type SokratesImpl

type SokratesImpl struct {
	Scheme  string
	BaseUrl string
	Client  HttpClient
}

func NewFakeSokratesConfig

func NewFakeSokratesConfig(scheme, baseUrl string, client HttpClient) (*SokratesImpl, error)

func NewSokratesConfig

func NewSokratesConfig(schema OdysseiaApi, ca []byte) (*SokratesImpl, error)

func (*SokratesImpl) Check added in v0.1.10

func (s *SokratesImpl) Check(body []byte, requestID string) (*http.Response, error)

func (*SokratesImpl) Create added in v0.1.10

func (s *SokratesImpl) Create(body []byte, requestID string) (*http.Response, error)

func (*SokratesImpl) Health

func (s *SokratesImpl) Health(uuid string) (*http.Response, error)

func (*SokratesImpl) Options added in v0.1.10

func (s *SokratesImpl) Options(quizType string, requestID string) (*http.Response, error)

type Solon

type Solon interface {
	Health(uuid string) (*http.Response, error)
	OneTimeToken(uuid string) (*http.Response, error)
	Register(requestBody models.SolonCreationRequest, uuid string) (*http.Response, error)
}

type SolonImpl

type SolonImpl struct {
	Scheme  string
	BaseUrl string
	Client  HttpClient
}

func NewFakeSolonImpl

func NewFakeSolonImpl(scheme, baseUrl string, client HttpClient) (*SolonImpl, error)

func NewSolonImpl

func NewSolonImpl(schema OdysseiaApi, ca []byte) (*SolonImpl, error)

func (*SolonImpl) Health

func (s *SolonImpl) Health(uuid string) (*http.Response, error)

func (*SolonImpl) OneTimeToken

func (s *SolonImpl) OneTimeToken(uuid string) (*http.Response, error)

func (*SolonImpl) Register

func (s *SolonImpl) Register(requestBody models.SolonCreationRequest, uuid string) (*http.Response, error)

Jump to

Keyboard shortcuts

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