convoy_cli

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

README

convoy-cli

Convoy CLI is a tool for debugging convoy webhook events locally.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteConfigFile

func DeleteConfigFile() error

func GetVersion

func GetVersion() string

func HasDefaultConfigFile

func HasDefaultConfigFile(path string) bool

func IsNewHost

func IsNewHost(currentHost, newHost string) bool

func ReadVersion

func ReadVersion() ([]byte, error)

Types

type AckEventDelivery

type AckEventDelivery struct {
	UID string `json:"uid"`
}

type CLIEvent

type CLIEvent struct {
	UID     string              `json:"uid"`
	Headers map[string][]string `json:"headers"`
	Data    json.RawMessage     `json:"data"`
}

type Config

type Config struct {
	Host            string          `yaml:"host"`
	ActiveApiKey    string          `yaml:"active_api_key"`
	ActiveProjectID string          `yaml:"active_project_id"`
	Projects        []ConfigProject `yaml:"projects"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig() (*Config, error)

func NewConfig

func NewConfig(host, apiKey string) (*Config, error)

func (*Config) HasDefaultConfigFile

func (c *Config) HasDefaultConfigFile() bool

func (*Config) UpdateConfig

func (c *Config) UpdateConfig(response *LoginResponse, isLogin bool) error

func (*Config) WriteToDisk

func (c *Config) WriteToDisk() error

type ConfigProject

type ConfigProject struct {
	UID  string `yaml:"uid"`
	Name string `yaml:"name"`
	Host string `yaml:"host"`
	Type string `yaml:"type"`
	//ApiKey   string `yaml:"api_key"`
	DeviceID string `yaml:"device_id"`
}

type Device

type Device struct {
	UID        string             `json:"uid"`
	ProjectID  string             `json:"project_id,omitempty"`
	EndpointID string             `json:"endpoint_id,omitempty"`
	HostName   string             `json:"host_name,omitempty"`
	Status     string             `json:"status,omitempty"`
	LastSeenAt primitive.DateTime `json:"last_seen_at,omitempty"`
}

type Endpoint

type Endpoint struct {
	UID         string `json:"uid"`
	ProjectID   string `json:"project_id"`
	OwnerID     string `json:"owner_id,omitempty"`
	TargetURL   string `json:"target_url"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type ListenRequest

type ListenRequest struct {
	HostName   string `json:"host_name"`
	ProjectID  string `json:"project_id"`
	DeviceID   string `json:"device_id"`
	SourceName string `json:"source_name"`

	Since     string `json:"-"`
	ForwardTo string `json:"-"`
}

type Listener

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

func NewListener

func NewListener(c *Config) *Listener

func (*Listener) HandleMessage

func (l *Listener) HandleMessage(connection *websocket.Conn, url string)

func (*Listener) Listen

func (l *Listener) Listen(listenRequest *ListenRequest, hostInfo *url.URL)

func (*Listener) PingUntilInterrupt

func (l *Listener) PingUntilInterrupt(conn *websocket.Conn)

type LoginRequest

type LoginRequest struct {
	HostName string `json:"host_name"`
	DeviceID string `json:"device_id"`
}

type LoginResponse

type LoginResponse struct {
	Projects []ProjectDevice `json:"projects"`
	UserName string          `json:"user_name"`
}

type Project

type Project struct {
	UID            string `json:"uid"`
	Name           string `json:"name"`
	OrganisationID string `json:"organisation_id"`
	Type           string `json:"type"`
}

type ProjectDevice

type ProjectDevice struct {
	Project *Project `json:"project"`
	Device  *Device  `json:"device"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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