beeperapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBridge

func DeleteBridge(domain, bridgeName, token string) error

func PostBridgeState

func PostBridgeState(domain, username, bridgeName, asToken string, data ReqPostBridgeState) error

Types

type BridgeState

type BridgeState struct {
	Username   string                  `json:"username"`
	Bridge     string                  `json:"bridge"`
	StateEvent status.BridgeStateEvent `json:"stateEvent"`
	Source     string                  `json:"source"`
	CreatedAt  time.Time               `json:"createdAt"`
	Reason     string                  `json:"reason"`
	Info       map[string]any          `json:"info"`
}

type ReqPostBridgeState

type ReqPostBridgeState struct {
	StateEvent status.BridgeStateEvent `json:"stateEvent"`
	Reason     string                  `json:"reason"`
	Info       map[string]any          `json:"info"`
}

type RespWhoami

type RespWhoami struct {
	User     WhoamiUser     `json:"user"`
	UserInfo WhoamiUserInfo `json:"userInfo"`
}

func Whoami

func Whoami(baseDomain, token string) (resp *RespWhoami, err error)

type WhoamiAsmuxData

type WhoamiAsmuxData struct {
	ID         string `json:"id"`
	APIToken   string `json:"api_token"`
	LoginToken string `json:"login_token"`
}

type WhoamiBridge

type WhoamiBridge struct {
	Version       string `json:"version"`
	ConfigHash    string `json:"configHash"`
	OtherVersions []struct {
		Name    string `json:"name"`
		Version string `json:"version"`
	} `json:"otherVersions"`
	BridgeState BridgeState                   `json:"bridgeState"`
	RemoteState map[string]status.BridgeState `json:"remoteState"`
}

type WhoamiUser

type WhoamiUser struct {
	Bridges    map[string]WhoamiBridge `json:"bridges"`
	Hungryserv WhoamiBridge            `json:"hungryserv"`
	AsmuxData  WhoamiAsmuxData         `json:"asmuxData"`
}

type WhoamiUserInfo

type WhoamiUserInfo struct {
	CreatedAt           time.Time `json:"createdAt"`
	Username            string    `json:"username"`
	Email               string    `json:"email"`
	FullName            string    `json:"fullName"`
	Channel             string    `json:"channel"`
	Admin               bool      `json:"isAdmin"`
	BridgeChangesLocked bool      `json:"isUserBridgeChangesLocked"`
	Free                bool      `json:"isFree"`
	DeletedAt           time.Time `json:"deletedAt"`
	SupportRoomID       id.RoomID `json:"supportRoomId"`
	UseHungryserv       bool      `json:"useHungryserv"`
	BridgeClusterID     string    `json:"bridgeClusterId"`
}

Jump to

Keyboard shortcuts

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