common

package
v0.0.0-...-ca0e7a9 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Unlicense Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// published so the user can find out where his central/operators are later on
	KindSetupAnnouncement nostr.Kind = 16440

	// created at setup time by the user and sent to central/operators
	KindCentralToken         nostr.Kind = 20443
	KindOperatorRegistration nostr.Kind = 20444
	KindCentralRegistration  nostr.Kind = 20445

	// used in the communication between central and operators, signed always only by the central key
	KindConfiguration   nostr.Kind = 26430
	KindGroupCommit     nostr.Kind = 26432
	KindEventToBeSigned nostr.Kind = 26433
	KindECDHRequest     nostr.Kind = 26434
)

Variables

Functions

func HandleAppleLogin

func HandleAppleLogin(oauthConfig *oauth2.Config) http.HandlerFunc

func HandleGitHubLogin

func HandleGitHubLogin(oauthConfig *oauth2.Config) http.HandlerFunc

func HandleGoogleLogin

func HandleGoogleLogin(oauthConfig *oauth2.Config) http.HandlerFunc

func HandleMicrosoftLogin

func HandleMicrosoftLogin(oauthConfig *oauth2.Config) http.HandlerFunc

Types

type AppleUser

type AppleUser struct {
	ID    string `json:"sub"`
	Email string `json:"email"`
}

func HandleAppleCallback

func HandleAppleCallback(r *http.Request, clientID string) (AppleUser, string, error)

type GitHubEmail

type GitHubEmail struct {
	Email    string `json:"email"`
	Primary  bool   `json:"primary"`
	Verified bool   `json:"verified"`
}

type GitHubUser

type GitHubUser struct {
	ID    int    `json:"id"`
	Login string `json:"login"`
	Email string `json:"email"`
}

func HandleGitHubCallback

func HandleGitHubCallback(r *http.Request, oauthConfig *oauth2.Config) (GitHubUser, string, error)

type GoogleUser

type GoogleUser struct {
	ID            string `json:"id"`
	Email         string `json:"email"`
	VerifiedEmail bool   `json:"verified_email"`
	Picture       string `json:"picture"`
}

func HandleGoogleCallback

func HandleGoogleCallback(r *http.Request, oauthConfig *oauth2.Config) (GoogleUser, string, error)

type MicrosoftUser

type MicrosoftUser struct {
	ID                string `json:"id"`
	Mail              string `json:"mail"`
	UserPrincipalName string `json:"userPrincipalName"`
}

func HandleMicrosoftCallback

func HandleMicrosoftCallback(r *http.Request, oauthConfig *oauth2.Config) (MicrosoftUser, string, error)

Jump to

Keyboard shortcuts

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