client

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalizer added in v1.1.4

func NewLocalizer(locale string) train.Interceptor

func PrivateRSAKeyFromB64String added in v1.1.4

func PrivateRSAKeyFromB64String(str string) (*rsa.PrivateKey, error)

Types

type AboutService

type AboutService interface {
	Get() (models.AppInfo, error)
}

AboutService about service interface

type AdapterFilter

type AdapterFilter struct {
	AdapterType models.AdapterType
}

AdapterFilter defines filter for adpater list

type AdapterService

type AdapterService interface {
	GetAll() ([]models.Adapter, error)
	GetFiltered(adapterType *models.AdapterType) ([]models.Adapter, error)
	Get(adapterID string) (models.Adapter, error)
}

AdapterService adapter service interface

type Client

type Client struct {
	Adapters AdapterService
	About    AboutService
	Events   EventService
	Snippets SnippetService
	Tags     TagService
	Runs     RunService
	Jobs     JobService
	Licenses LicenseService
	Ws       WsService
}

Client represents main client structure. It is used to communicate with server API

func New

func New(host string, interceptors ...train.Interceptor) *Client

New create new client to communicate with server API

type DesktopClaims added in v1.1.4

type DesktopClaims struct {
	Certs []string `json:"x5c"`
	jwt.StandardClaims
	// contains filtered or unexported fields
}

type ErrorHandler

type ErrorHandler func(e error)

ErrorHandler error handler func specific type

type EventFilter

type EventFilter struct {
	Name    *models.EventName
	SortBy  *string
	SortDir *string
	Offset  *int
	Limit   *int
}

EventFilter defines filter for event list

type EventHandler

type EventHandler func(e models.Event)

EventHandler event handler func specific type

type EventService

type EventService interface {
	GetAll() ([]models.Event, models.PageInfo, error)
	GetFiltered(adapterID *string, filter EventFilter) ([]models.Event, models.PageInfo, error)
	Add(event models.NewEvent) (models.Event, error)
}

EventService event service interface

type JobFilter

type JobFilter struct {
	Status  *models.JobStatus
	SortBy  *string
	SortDir *string
	Limit   *int
	Offset  *int
}

JobFilter defines filter for job list

type JobService

type JobService interface {
	GetAll(adapterID string) ([]models.Job, models.PageInfo, error)
	GetFiltered(adapterID string, filter JobFilter) ([]models.Job, models.PageInfo, error)
	Delete(adapterID string, jobID string) error
	DeleteAll(adapterID string) error
	Get(adapterID string, jobID string) (models.Job, error)
	Add(adapterID string, job models.NewJob) (models.Job, error)
	UpdateStatus(adapterID string, jobID string, status models.JobStatus) (models.Job, error)
}

JobService job service interface

type LicenseService added in v1.1.4

type LicenseService interface {
	GetLicense() (models.License, error)
	GetAppLicense(appID string) (models.AppLicense, error)
}

license service interface

type Localizer added in v1.1.4

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

func (*Localizer) Intercept added in v1.1.4

func (i *Localizer) Intercept(chain train.Chain) (*http.Response, error)

type RunFilter

type RunFilter struct {
	JobID   *string
	Status  *models.JobRunStatus
	SortBy  *string
	SortDir *string
	Limit   *int
	Offset  *int
}

RunFilter defines filter for run list

type RunService

type RunService interface {
	GetAll(adapterID string) ([]models.JobRun, models.PageInfo, error)
	GetFiltered(adapterID string, filter RunFilter) ([]models.JobRun, models.PageInfo, error)
	Get(adapterID string, runID string) (models.JobRun, error)
}

RunService run service interface

type Signer added in v1.1.4

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

func NewSigner added in v1.1.4

func NewSigner(appID string, secret *rsa.PrivateKey, cert string) *Signer

train.Interceptor

func (*Signer) Intercept added in v1.1.4

func (s *Signer) Intercept(chain train.Chain) (*http.Response, error)

func (*Signer) MID added in v1.1.4

func (s *Signer) MID() string

func (*Signer) SetMID added in v1.1.4

func (s *Signer) SetMID(mid string)

func (*Signer) Sign added in v1.1.4

func (s *Signer) Sign(req *http.Request) error

type SnippetFilter

type SnippetFilter struct {
	Category *models.SnippetCategory
	UsageID  *string
}

SnippetFilter defines filter for snippet list

type SnippetService

type SnippetService interface {
	GetAll() ([]models.Snippet, error)
	GetFiltered(filter SnippetFilter) ([]models.Snippet, error)
}

SnippetService snippet service interface

type TagService

type TagService interface {
	GetAll(adapterID string, tagType *models.TagType) ([]models.Tag, error)
	Get(adapterID string, tagID string) (models.Tag, error)
}

TagService tag service interface

type WsService

type WsService interface {
	Connect() error
	Disconnect() error
	IsConnected() bool
	OnEvent(EventHandler)
	ConnString() string
	OnError(ErrorHandler)
	SetLocale(locale string) error
}

WsService websocket service interface

Jump to

Keyboard shortcuts

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