client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound                     = errors.New("not found")
	ErrSpaceIDRequired              = errors.New("spaceID is required")
	ErrChannelIDRequired            = errors.New("channelID is required")
	ErrRoomIDRequired               = errors.New("roomID is required")
	ErrMemberIDRequired             = errors.New("memberID is required")
	ErrNodeID                       = errors.New("nodeID is required")
	ErrNodeMembershipIDRequired     = errors.New("nodeMembershipID is required")
	ErrNodeMembershipActionRequired = errors.New("nodeMembershipAction is required")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HostURL    string
	HTTPClient *http.Client
	AuthToken  string
}

func NewClient

func NewClient(url, auth_token string) *Client

func (*Client) CreateDiscordChannel

func (c *Client) CreateDiscordChannel(spaceID string, commonParams NotificationChannel, discordParams NotificationDiscordChannel) (*NotificationChannel, error)

func (*Client) CreateNodeMembershipRule added in v0.3.0

func (c *Client) CreateNodeMembershipRule(spaceID, roomID, action, description string, clauses []NodeMembershipClause) (*NodeMembershipRule, error)

func (*Client) CreateNodeRoomMember added in v0.2.0

func (c *Client) CreateNodeRoomMember(spaceID, roomID, nodeID string) error

func (*Client) CreatePagerdutyChannel

func (c *Client) CreatePagerdutyChannel(spaceID string, commonParams NotificationChannel, pagerdutyParams NotificationPagerdutyChannel) (*NotificationChannel, error)

func (*Client) CreateRoom

func (c *Client) CreateRoom(spaceID, name, description string) (*RoomInfo, error)

func (*Client) CreateRoomMember

func (c *Client) CreateRoomMember(spaceID, roomID, spaceMemberID string) error

func (*Client) CreateSlackChannel

func (c *Client) CreateSlackChannel(spaceID string, commonParams NotificationChannel, slackParams NotificationSlackChannel) (*NotificationChannel, error)

func (*Client) CreateSpace

func (c *Client) CreateSpace(name, description string) (*SpaceInfo, error)

func (*Client) CreateSpaceMember

func (c *Client) CreateSpaceMember(spaceID, email, role string) (*SpaceMember, error)

func (*Client) DeleteChannelByID

func (c *Client) DeleteChannelByID(spaceID, channelID string) error

func (*Client) DeleteInvitations

func (c *Client) DeleteInvitations(spaceID string, invitations *[]Invitation) error

func (*Client) DeleteNodeMembershipRule added in v0.3.0

func (c *Client) DeleteNodeMembershipRule(spaceID, roomID, nodeMembershipID string) error

func (*Client) DeleteNodeRoomMember added in v0.2.0

func (c *Client) DeleteNodeRoomMember(spaceID, roomID, nodeID string) error

func (*Client) DeleteRoomByID

func (c *Client) DeleteRoomByID(id, spaceID string) error

func (*Client) DeleteRoomMember

func (c *Client) DeleteRoomMember(spaceID, roomID, spaceMemberID string) error

func (*Client) DeleteSpaceByID

func (c *Client) DeleteSpaceByID(id string) error

func (*Client) DeleteSpaceMember

func (c *Client) DeleteSpaceMember(spaceID, memberID string) error

func (*Client) EnableChannelByID

func (c *Client) EnableChannelByID(spaceID, channelID string, enabled bool) error

func (*Client) GetAllNodes added in v0.2.0

func (c *Client) GetAllNodes(spaceID string) (*RoomNodes, error)

func (*Client) GetInvitations

func (c *Client) GetInvitations(spaceID string) (*[]Invitation, error)

func (*Client) GetNodeMembershipRule added in v0.3.0

func (c *Client) GetNodeMembershipRule(spaceID, roomID, nodeMembershipID string) (*NodeMembershipRule, error)

func (*Client) GetNotificationChannelByIDAndType

func (c *Client) GetNotificationChannelByIDAndType(spaceID, channelID, typeName string) (*NotificationChannel, error)

func (*Client) GetNotificationChannelByType

func (c *Client) GetNotificationChannelByType(spaceID, typeName string) (*[]NotificationChannel, error)

func (*Client) GetNotificationIntegrationByType

func (c *Client) GetNotificationIntegrationByType(spaceID, typeName string) (*NotificationIntegration, error)

func (*Client) GetRoomByID

func (c *Client) GetRoomByID(id, spaceID string) (*RoomInfo, error)

func (*Client) GetRoomMemberID

func (c *Client) GetRoomMemberID(spaceID, roomID, spaceMemberID string) (*RoomMember, error)

func (*Client) GetRoomMembers

func (c *Client) GetRoomMembers(spaceID, roomID string) (*[]RoomMember, error)

func (*Client) GetRoomNodes added in v0.2.0

func (c *Client) GetRoomNodes(spaceID, roomID string) (*RoomNodes, error)

func (*Client) GetRooms

func (c *Client) GetRooms(spaceID string) (*[]RoomInfo, error)

func (*Client) GetSpaceByID

func (c *Client) GetSpaceByID(id string) (*SpaceInfo, error)

func (*Client) GetSpaceClaimToken

func (c *Client) GetSpaceClaimToken(id string) (*string, error)

func (*Client) GetSpaceMemberID

func (c *Client) GetSpaceMemberID(spaceID, memberID string) (*SpaceMember, error)

func (*Client) GetSpaceMembers

func (c *Client) GetSpaceMembers(spaceID string) (*[]SpaceMember, error)

func (*Client) GetSpaces

func (c *Client) GetSpaces() (*[]SpaceInfo, error)

func (*Client) ListNodeMembershipRules added in v0.3.0

func (c *Client) ListNodeMembershipRules(spaceID, roomID string) ([]NodeMembershipRule, error)

func (*Client) UpdateDiscordChannelByID

func (c *Client) UpdateDiscordChannelByID(spaceID string, commonParams NotificationChannel, discordParams NotificationDiscordChannel) (*NotificationChannel, error)

func (*Client) UpdateNodeMembershipRule added in v0.3.0

func (c *Client) UpdateNodeMembershipRule(spaceID, roomID, nodeMembershipID, action, description string, clauses []NodeMembershipClause) (*NodeMembershipRule, error)

func (*Client) UpdatePagerdutyChannelByID

func (c *Client) UpdatePagerdutyChannelByID(spaceID string, commonParams NotificationChannel, pagerdutyParams NotificationPagerdutyChannel) (*NotificationChannel, error)

func (*Client) UpdateRoomByID

func (c *Client) UpdateRoomByID(id, spaceID, name, description string) error

func (*Client) UpdateSlackChannelByID

func (c *Client) UpdateSlackChannelByID(spaceID string, commonParams NotificationChannel, slackParams NotificationSlackChannel) (*NotificationChannel, error)

func (*Client) UpdateSpaceByID

func (c *Client) UpdateSpaceByID(id, name, description string) error

func (*Client) UpdateSpaceMemberRoleByID

func (c *Client) UpdateSpaceMemberRoleByID(spaceID, memberID, role string) error

type Invitation

type Invitation struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

type NodeMembershipClause added in v0.3.0

type NodeMembershipClause struct {
	Label    string `json:"label"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
	Negate   bool   `json:"negate"`
}

type NodeMembershipRule added in v0.3.0

type NodeMembershipRule struct {
	ID          uuid.UUID              `json:"id"`
	SpaceID     uuid.UUID              `json:"spaceID"`
	RoomID      uuid.UUID              `json:"roomID"`
	Clauses     []NodeMembershipClause `json:"clauses"`
	Action      string                 `json:"action"`
	Description string                 `json:"description"`
}

type NotificationChannel

type NotificationChannel struct {
	ID                       string                  `json:"id"`
	Enabled                  bool                    `json:"enabled"`
	Name                     string                  `json:"name"`
	Integration              NotificationIntegration `json:"integration"`
	Alarms                   string                  `json:"alarms"`
	Rooms                    []string                `json:"rooms"`
	Secrets                  json.RawMessage         `json:"secrets"`
	RepeatNotificationMinute int64                   `json:"repeat_notification_min,omitempty"`
}

type NotificationDiscordChannel

type NotificationDiscordChannel struct {
	URL           string `json:"url"`
	ChannelParams struct {
		Selection  string `json:"selection"`
		ThreadName string `json:"threadName"`
	} `json:"channelParams"`
}

type NotificationIntegration

type NotificationIntegration struct {
	ID   string `json:"id"`
	Name string `json:"slug"`
}

type NotificationIntegrations

type NotificationIntegrations struct {
	Integrations []NotificationIntegration `json:"integrations"`
}

type NotificationPagerdutyChannel

type NotificationPagerdutyChannel struct {
	AlertEventsURL string `json:"alertEventsURL"`
	IntegrationKey string `json:"integrationKey"`
}

type NotificationSlackChannel

type NotificationSlackChannel struct {
	URL string `json:"url"`
}

type RoomInfo

type RoomInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type RoomMember

type RoomMember struct {
	SpaceMemberID string `json:"memberID"`
}

type RoomNode added in v0.2.0

type RoomNode struct {
	NodeID   string `json:"nd"`
	NodeName string `json:"nm"`
	State    string `json:"state"`
}

type RoomNodes added in v0.2.0

type RoomNodes struct {
	Nodes []RoomNode `json:"nodes"`
}

type SpaceInfo

type SpaceInfo struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type SpaceMember

type SpaceMember struct {
	Email    string `json:"email"`
	MemberID string `json:"memberID"`
	Role     string `json:"role"`
}

Jump to

Keyboard shortcuts

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