rest

package
v0.0.0-...-6abc620 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 29 Imported by: 1

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
}

Client provides an interface for interacting with a remote amboy Service.

func NewClient

func NewClient(opts ClientOptions) (*Client, error)

NewClient takes host, port, and URI prefix information and constructs a new Client.

func NewClientFromExisting

func NewClientFromExisting(client *http.Client, opts ClientOptions) (*Client, error)

NewClientFromExisting takes an existing http.Client object and produces a new Client object.

func (*Client) AcknowledgeSystemEvent

func (c *Client) AcknowledgeSystemEvent(ctx context.Context, id string) (*SystemEventResponse, error)

func (*Client) Client

func (c *Client) Client() *http.Client

Client returns a pointer to embedded http.Client object.

func (*Client) Copy

func (c *Client) Copy() *Client

Copy takes an existing Client object and returns a new client object with the same settings that uses a *new* http.Client.

func (*Client) DisableFeatureFlag

func (c *Client) DisableFeatureFlag(ctx context.Context, name string) (bool, error)

func (*Client) EnableFeatureFlag

func (c *Client) EnableFeatureFlag(ctx context.Context, name string) (bool, error)

func (*Client) FindPerformanceResultById

func (c *Client) FindPerformanceResultById(ctx context.Context, id string) (*model.APIPerformanceResult, error)

func (*Client) GetApiKey

func (c *Client) GetApiKey() string

func (*Client) GetRootCertificate

func (c *Client) GetRootCertificate(ctx context.Context) (string, error)

func (*Client) GetSimpleLog

func (c *Client) GetSimpleLog(ctx context.Context, logID string) (*SimpleLogContentResponse, error)

func (*Client) GetSimpleLogText

func (c *Client) GetSimpleLogText(ctx context.Context, logID string) ([]string, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) (*StatusResponse, error)

func (*Client) GetSystemEvent

func (c *Client) GetSystemEvent(ctx context.Context, id string) (*SystemEventResponse, error)

func (*Client) GetSystemEvents

func (c *Client) GetSystemEvents(ctx context.Context, level string, limit int) (*SystemEventsResponse, error)

func (*Client) GetSystemInformation

func (c *Client) GetSystemInformation(ctx context.Context, host string, start, end time.Time, limit int) ([]*message.SystemInfo, error)

func (*Client) GetUser

func (c *Client) GetUser() string

func (*Client) GetUserCertificate

func (c *Client) GetUserCertificate(ctx context.Context, username, password, apiKey string) (string, error)

func (*Client) GetUserCertificateKey

func (c *Client) GetUserCertificateKey(ctx context.Context, username, password, apiKey string) (string, error)

func (*Client) Host

func (c *Client) Host() string

Host returns the current host.

func (*Client) Port

func (c *Client) Port() int

Port returns the current port value for the Client.

func (*Client) Prefix

func (c *Client) Prefix() string

Prefix accesses the prefix for the client, The prefix is the part of the URI between the end-point and the hostname, of the API.

func (*Client) RemovePerformanceResultById

func (c *Client) RemovePerformanceResultById(ctx context.Context, id string) (string, error)

func (*Client) SendSystemInfo

func (c *Client) SendSystemInfo(ctx context.Context, info *message.SystemInfo) (*SystemInfoReceivedResponse, error)

func (*Client) SetHost

func (c *Client) SetHost(h string) error

SetHost allows callers to change the hostname (including leading "http(s)") for the Client. Returns an error if the specified host does not start with "http".

func (*Client) SetPort

func (c *Client) SetPort(p int) error

SetPort allows callers to change the port used for the client. If the port is invalid, returns an error and sets the port to the default value. (3000)

func (*Client) SetPrefix

func (c *Client) SetPrefix(p string) error

SetPrefix allows callers to modify the prefix, for this client,

func (*Client) SetUser

func (c *Client) SetUser(u, k string)

func (*Client) WriteSimpleLog

func (c *Client) WriteSimpleLog(ctx context.Context, logID, data string, increment int) (*SimpleLogIngestionResponse, error)

type ClientOptions

type ClientOptions struct {
	Host     string
	Port     int
	Prefix   string
	Username string
	ApiKey   string
}

type Service

type Service struct {
	Port        int
	Prefix      string
	Environment cedar.Environment
	Conf        *model.CedarConfig
	UserManager gimlet.UserManager

	RPCServers []string
	Depot      certdepot.Depot
	// contains filtered or unexported fields
}

func (*Service) Start

func (s *Service) Start(ctx context.Context) (gimlet.WaitFunc, error)

func (*Service) Validate

func (s *Service) Validate() error

type SimpleLogContentResponse

type SimpleLogContentResponse struct {
	LogID string   `json:"logId"`
	Error string   `json:"err,omitempty"`
	URLS  []string `json:"urls"`
}

type SimpleLogIngestionResponse

type SimpleLogIngestionResponse struct {
	Errors []string `json:"errors,omitempty"`
	JobID  string   `json:"jobId,omitempty"`
	LogID  string   `json:"logId"`
}

type StatusResponse

type StatusResponse struct {
	Revision string   `json:"revision"`
	RPCInfo  []string `json:"rpc_service"`
}

type SystemEventResponse

type SystemEventResponse struct {
	ID    string       `json:"id"`
	Error string       `json:"error"`
	Event *model.Event `json:"event"`
}

type SystemEventsResponse

type SystemEventsResponse struct {
	Level  string         `json:"level,omitempty"`
	Total  int            `json:"total,omitempty"`
	Count  int            `json:"count,omitempty"`
	Events []*model.Event `json:"events"`
	Err    string         `json:"error"`
}

type SystemInfoReceivedResponse

type SystemInfoReceivedResponse struct {
	ID        string    `json:"id,omitempty"`
	Hostname  string    `json:"host,omitempty"`
	Timestamp time.Time `json:"time,omitempty"`
	Error     string    `json:"err,omitempty"`
}

type SystemInformationResponse

type SystemInformationResponse struct {
	Error string                `json:"error,omitempty"`
	Data  []*message.SystemInfo `json:"data"`
	Total int                   `json:"total,omitempty"`
	Limit int                   `json:"limit,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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