Help us shape the future of Go! Take the 2026 Go Developer Survey

web

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interactor

type Interactor interface {
	FindUserByID(ctx context.Context, id int64) (*ent.User, error)
	IsAdminUser(ctx context.Context, login string) bool
	IsEntryMember(ctx context.Context, login string) bool
	IsOrgMember(ctx context.Context, orgs []string) bool
	CreateUser(ctx context.Context, u *ent.User) (*ent.User, error)
	UpdateUser(ctx context.Context, u *ent.User) (*ent.User, error)
	// Fetch the user information from SCM.
	// It has the id, login, avatar and so on.
	GetRemoteUserByToken(ctx context.Context, token string) (*extent.RemoteUser, error)
	ListRemoteOrgsByToken(ctx context.Context, token string) ([]string, error)
	FindUserByHash(ctx context.Context, hash string) (*ent.User, error)
	FindRepoOfUserByNamespaceName(ctx context.Context, u *ent.User, opt *i.FindRepoOfUserByNamespaceNameOptions) (*ent.Repo, error)
	GetConfigRedirectURL(ctx context.Context, u *ent.User, r *ent.Repo) (string, error)
	GetNewConfigRedirectURL(ctx context.Context, u *ent.User, r *ent.Repo) (string, error)
	GetLicense(ctx context.Context) (*extent.License, error)
}

type Web

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

func NewWeb

func NewWeb(c *WebConfig) *Web

func (*Web) IndexHTML

func (w *Web) IndexHTML(c *gin.Context)

func (*Web) IndexString

func (w *Web) IndexString(c *gin.Context)

func (*Web) RedirectToConfig

func (w *Web) RedirectToConfig(c *gin.Context)

RedirectToConfig redirects to the URL to read the configuration file.

func (*Web) RedirectToNewConfig

func (w *Web) RedirectToNewConfig(c *gin.Context)

RedirectToNewConfig redirect to the URL to create a new file.

func (*Web) SignOutHTML

func (w *Web) SignOutHTML(c *gin.Context)

func (*Web) SignOutString

func (w *Web) SignOutString(c *gin.Context)

func (*Web) Signin

func (w *Web) Signin(c *gin.Context)

type WebConfig

type WebConfig struct {
	Config     *oauth2.Config
	Interactor Interactor
	AdminUsers []string
}

Jump to

Keyboard shortcuts

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