dashboard

package
v1.46.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const AddRecordTopic = "history:addrecord"

Variables

This section is empty.

Functions

func NewHistoryError added in v1.20.0

func NewHistoryError(recordType RecordType, historyFile string) error

Types

type ApiHistoryItem added in v1.19.0

type ApiHistoryItem struct {
	Api      string           `json:"api"`
	Request  *RequestHistory  `json:"request"`
	Response *ResponseHistory `json:"response"`
}

type ApiSpec added in v1.34.0

type ApiSpec struct {
	*BaseResourceSpec

	OpenApiSpec *openapi3.T `json:"spec"`
}

type BaseResourceSpec added in v1.34.0

type BaseResourceSpec struct {
	Name string `json:"name"`
	// TODO: Remove this field
	RequestingServices []string `json:"requestingServices"`
}

type Bucket added in v1.18.0

type Bucket struct {
	Name         string     `json:"name,omitempty"`
	CreationDate *time.Time `json:"creationDate,omitempty"`
}

type BucketSpec added in v1.34.0

type BucketSpec struct {
	*BaseResourceSpec
}

type Dashboard added in v1.18.0

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

func New

func New(noBrowser bool, localCloud *cloud.LocalCloud, project *project.Project) (*Dashboard, error)

func (*Dashboard) DeleteHistoryRecord added in v1.34.0

func (d *Dashboard) DeleteHistoryRecord(recordType RecordType) error

func (*Dashboard) GetDashboardUrl added in v1.34.0

func (d *Dashboard) GetDashboardUrl() string

func (*Dashboard) ReadAllHistoryRecords added in v1.34.0

func (d *Dashboard) ReadAllHistoryRecords() (*HistoryEvents, error)

func (*Dashboard) Start added in v1.34.0

func (d *Dashboard) Start() error

type DashboardResponse added in v1.19.0

type DashboardResponse struct {
	Apis          []ApiSpec          `json:"apis"`
	Buckets       []*BucketSpec      `json:"buckets"`
	Schedules     []ScheduleSpec     `json:"schedules"`
	Topics        []*TopicSpec       `json:"topics"`
	Websockets    []WebsocketSpec    `json:"websockets"`
	Subscriptions []*SubscriberSpec  `json:"subscriptions"`
	Notifications []*NotifierSpec    `json:"notifications"`
	Stores        []*KeyValueSpec    `json:"stores"`
	SQLDatabases  []*SQLDatabaseSpec `json:"sqlDatabases"`
	Queues        []*QueueSpec       `json:"queues"`
	HttpProxies   []*HttpProxySpec   `json:"httpProxies"`

	Services []*ServiceSpec `json:"services"`

	Policies            map[string]PolicySpec `json:"policies"`
	ProjectName         string                `json:"projectName"`
	ApiAddresses        map[string]string     `json:"apiAddresses"`
	WebsocketAddresses  map[string]string     `json:"websocketAddresses"`
	HttpWorkerAddresses map[string]string     `json:"httpWorkerAddresses"`
	TriggerAddress      string                `json:"triggerAddress"`
	StorageAddress      string                `json:"storageAddress"`
	CurrentVersion      string                `json:"currentVersion"`
	LatestVersion       string                `json:"latestVersion"`
	Connected           bool                  `json:"connected"`
}

type HistoryEvent added in v1.34.0

type HistoryEvent[Event HistoryItem] struct {
	Time       int64      `json:"time,omitempty"`
	Event      Event      `json:"event"`
	RecordType RecordType `json:"-"`
}

func ReadHistoryRecords added in v1.19.0

func ReadHistoryRecords[T HistoryItem](projectDir string, recordType RecordType) ([]*HistoryEvent[T], error)

type HistoryEvents added in v1.34.0

type HistoryEvents struct {
	ScheduleHistory []*HistoryEvent[ScheduleHistoryItem] `json:"schedules"`
	TopicHistory    []*HistoryEvent[TopicHistoryItem]    `json:"topics"`
	ApiHistory      []*HistoryEvent[ApiHistoryItem]      `json:"apis"`
}

type HistoryItem added in v1.34.0

type HistoryItem interface {
	ApiHistoryItem | TopicHistoryItem | ScheduleHistoryItem | any
}

type HttpProxySpec added in v1.34.0

type HttpProxySpec struct {
	*BaseResourceSpec

	Target string `json:"target"`
}

type KeyValueSpec added in v1.34.0

type KeyValueSpec struct {
	*BaseResourceSpec
}

type NotifierSpec added in v1.34.0

type NotifierSpec struct {
	Bucket string `json:"bucket"`
	Target string `json:"target"`
}

type Param added in v1.19.0

type Param struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

type PolicyResource added in v1.34.0

type PolicyResource struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type PolicySpec added in v1.34.0

type PolicySpec struct {
	*BaseResourceSpec

	Principals []PolicyResource `json:"principals"`
	Actions    []string         `json:"actions"`
	Resources  []PolicyResource `json:"resources"`
}

type QueueSpec added in v1.34.0

type QueueSpec struct {
	*BaseResourceSpec
}

type RecordType added in v1.19.0

type RecordType string
const (
	API      RecordType = "apis"
	TOPIC    RecordType = "topics"
	SCHEDULE RecordType = "schedules"
)

type RequestHistory added in v1.19.0

type RequestHistory struct {
	Method      string              `json:"method"`
	Path        string              `json:"path"`
	QueryParams []Param             `json:"queryParams"`
	PathParams  []Param             `json:"pathParams"`
	Body        []byte              `json:"body"`
	Headers     map[string][]string `json:"headers"`
}

Only log what is required from req/resp to avoid massive log files

type ResponseHistory added in v1.19.0

type ResponseHistory struct {
	Data    interface{}         `json:"data"`
	Status  int32               `json:"status"`
	Size    int                 `json:"size"`
	Time    int64               `json:"time"`
	Headers map[string][]string `json:"headers"`
}

type SQLDatabaseSpec added in v1.42.0

type SQLDatabaseSpec struct {
	*BaseResourceSpec
}

type ScheduleHistoryItem added in v1.34.0

type ScheduleHistoryItem struct {
	Name    string `json:"name,omitempty"`
	Success bool   `json:"success,omitempty"`
}

type ScheduleSpec added in v1.34.0

type ScheduleSpec struct {
	*BaseResourceSpec

	Expression string `json:"expression,omitempty"`
	Rate       string `json:"rate,omitempty"`
	Target     string `json:"target,omitempty"`
}

type ServiceSpec added in v1.34.0

type ServiceSpec struct {
	*BaseResourceSpec

	FilePath string `json:"filePath"`
}

type SubscriberSpec added in v1.34.0

type SubscriberSpec struct {
	Topic  string `json:"topic"`
	Target string `json:"target"`
}

type TopicHistoryItem added in v1.34.0

type TopicHistoryItem struct {
	Name    string `json:"name,omitempty"`
	Delay   int    `json:"delay,omitempty"`
	Payload string `json:"payload,omitempty"`
	Success bool   `json:"success,omitempty"`
}

type TopicSpec added in v1.34.0

type TopicSpec struct {
	*BaseResourceSpec
}

type WebsocketSpec added in v1.34.0

type WebsocketSpec struct {
	*BaseResourceSpec

	Targets map[string]string `json:"targets,omitempty"`
}

Jump to

Keyboard shortcuts

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