bootstrap

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Oauth2EnabledCache = refreshcache0.NewRefreshCache[[]provider.OAuth2Provider](func(context.Context) ([]provider.OAuth2Provider, error) {
	ps := providers.EnabledProvider()
	r := make([]provider.OAuth2Provider, 0, ps.Len())
	ps.Range(func(p provider.OAuth2Provider, value struct{}) bool {
		r = append(r, p)
		return true
	})
	slices.SortStableFunc(r, func(a, b provider.OAuth2Provider) int {
		if a == b {
			return 0
		} else if natural.Less(a, b) {
			return -1
		} else {
			return 1
		}
	})
	return r, nil
}, 0)
View Source
var Oauth2SignupEnabledCache = refreshcache0.NewRefreshCache[[]provider.OAuth2Provider](func(ctx context.Context) ([]provider.OAuth2Provider, error) {
	ps := providers.EnabledProvider()
	r := make([]provider.OAuth2Provider, 0, ps.Len())
	ps.Range(func(p provider.OAuth2Provider, value struct{}) bool {
		group := model.SettingGroup(fmt.Sprintf("%s_%s", model.SettingGroupOauth2, p))
		groupSettings := ProviderGroupSettings[group]
		if groupSettings.Enabled.Get() && !groupSettings.DisableUserSignup.Get() {
			r = append(r, p)
		}
		return true
	})
	slices.SortStableFunc(r, func(a, b provider.OAuth2Provider) int {
		if a == b {
			return 0
		} else if natural.Less(a, b) {
			return -1
		} else {
			return 1
		}
	})
	return r, nil
}, 0)
View Source
var ProviderGroupSettings = make(map[model.SettingGroup]*ProviderGroupSetting)

Functions

func InitAggregationProviderSetting added in v0.4.2

func InitAggregationProviderSetting(pi provider.Provider)

func InitAggregationSetting added in v0.4.2

func InitAggregationSetting(pi provider.AggregationProviderInterface)

func InitCheckUpdate added in v0.2.4

func InitCheckUpdate(ctx context.Context) error

func InitConfig

func InitConfig(ctx context.Context) (err error)

func InitDatabase added in v0.3.0

func InitDatabase(ctx context.Context) (err error)

func InitDefaultConfig added in v0.2.4

func InitDefaultConfig(ctx context.Context) error

func InitDiscardLog added in v0.3.0

func InitDiscardLog(ctx context.Context) error

func InitGinMode added in v0.2.4

func InitGinMode(ctx context.Context) error

func InitLog

func InitLog(ctx context.Context) (err error)

func InitOp added in v0.3.0

func InitOp(ctx context.Context) error

func InitProvider added in v0.3.0

func InitProvider(ctx context.Context) (err error)

func InitProviderSetting added in v0.4.2

func InitProviderSetting(pi provider.Provider)

func InitRtmp added in v0.3.0

func InitRtmp(ctx context.Context) error

func InitSetting added in v0.3.0

func InitSetting(ctx context.Context) error

func InitStdLog added in v0.2.4

func InitStdLog(ctx context.Context) error

func InitSysNotify

func InitSysNotify(ctx context.Context) error

func InitVendorBackend added in v0.3.1

func InitVendorBackend(ctx context.Context) error

Types

type Bootstrap added in v0.2.4

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

func New added in v0.2.4

func New(conf ...BootstrapConf) *Bootstrap

func (*Bootstrap) Add added in v0.2.4

func (b *Bootstrap) Add(f ...BootstrapFunc) *Bootstrap

func (*Bootstrap) Run added in v0.2.4

func (b *Bootstrap) Run() error

type BootstrapConf added in v0.2.4

type BootstrapConf func(*Bootstrap)

func WithContext added in v0.2.4

func WithContext(ctx context.Context) BootstrapConf

func WithTask added in v0.2.4

func WithTask(f ...BootstrapFunc) BootstrapConf

type BootstrapFunc added in v0.2.4

type BootstrapFunc func(context.Context) error

type ProviderGroupSetting added in v0.3.1

type ProviderGroupSetting struct {
	Enabled           settings.BoolSetting
	ClientID          settings.StringSetting
	ClientSecret      settings.StringSetting
	RedirectURL       settings.StringSetting
	DisableUserSignup settings.BoolSetting
	SignupNeedReview  settings.BoolSetting
}

Jump to

Keyboard shortcuts

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