server

package
v0.0.0-...-7dc620a Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const TOKEN_SECRET = "Kia9012)f^#$$"

Variables

This section is empty.

Functions

func GetUser

func GetUser(ctx *gin.Context) (user entity.User)

func NewGoogleOAuthConfig

func NewGoogleOAuthConfig(oauthCfg config.GoogleOAuth) *oauth2.Config

Types

type APIHandler

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

func NewAPIHandler

func NewAPIHandler(
	db db.Database,
	rateGetter finmind.TaiwanExchangeRateGetter,
	dataDir string,
	mailSender *mail.Sender,
) (*APIHandler, error)

type EmailAddress

type EmailAddress struct {
	Value string `json:"value"`
}

type GoogleHandler

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

func NewGoogleHandler

func NewGoogleHandler(db db.Database, oauthCfg config.GoogleOAuth) *GoogleHandler

func (*GoogleHandler) Callback

func (h *GoogleHandler) Callback(ctx *gin.Context)

func (*GoogleHandler) Login

func (h *GoogleHandler) Login(ctx *gin.Context)

type Metadata

type Metadata struct {
	Sources []Source `json:"sources"`
}

type Name

type Name struct {
	DisplayName string `json:"displayName"`
	GivenName   string `json:"givenName"`
	FamilyName  string `json:"familyName"`
}

type PeopleResponse

type PeopleResponse struct {
	EmailAddresses []EmailAddress `json:"emailAddresses"`
	Names          []Name         `json:"names"`
	Metadata       Metadata       `json:"metadata"`
}

func (*PeopleResponse) GetDisplayName

func (r *PeopleResponse) GetDisplayName() string

func (*PeopleResponse) GetEmail

func (r *PeopleResponse) GetEmail() string

func (*PeopleResponse) GetID

func (r *PeopleResponse) GetID() string

type Server

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

func New

func New(db db.Database, cfg config.Config) (*Server, error)

func (*Server) Run

func (s *Server) Run(ctx context.Context, httpSetting config.HTTPSetting) error

type Source

type Source struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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