beeperapi

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLoginCode = fmt.Errorf("invalid login code")

Functions

func DeleteBridge

func DeleteBridge(domain, bridgeName, token string) error

func PostBridgeState

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

func SendLoginEmail added in v0.4.0

func SendLoginEmail(baseDomain, request, email string) 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"`
	IsSelfHosted bool                    `json:"isSelfHosted"`
	BridgeType   string                  `json:"bridgeType"`
}

type ReqPostBridgeState

type ReqPostBridgeState struct {
	StateEvent   status.BridgeStateEvent `json:"stateEvent"`
	Reason       string                  `json:"reason"`
	Info         map[string]any          `json:"info"`
	IsSelfHosted bool                    `json:"isSelfHosted"`
	BridgeType   string                  `json:"bridgeType,omitempty"`
}

type ReqSendLoginCode added in v0.4.0

type ReqSendLoginCode struct {
	RequestID string `json:"request"`
	Code      string `json:"response"`
}

type ReqSendLoginEmail added in v0.4.0

type ReqSendLoginEmail struct {
	RequestID string `json:"request"`
	Email     string `json:"email"`
}

type RespSendLoginCode added in v0.4.0

type RespSendLoginCode struct {
	LoginToken string      `json:"token"`
	Whoami     *RespWhoami `json:"whoami"`
}

func SendLoginCode added in v0.4.0

func SendLoginCode(baseDomain, request, code string) (resp *RespSendLoginCode, err error)

type RespStartLogin added in v0.4.0

type RespStartLogin struct {
	RequestID string    `json:"request"`
	Type      []string  `json:"type"`
	Expires   time.Time `json:"expires"`
}

func StartLogin added in v0.4.0

func StartLogin(baseDomain string) (resp *RespStartLogin, err error)

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 {
	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"`
	AnalyticsID         string    `json:"analyticsId"`
	FakeHungryURL       string    `json:"hungryUrl"`
	HungryURL           string    `json:"hungryUrlDirect"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳