controller

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context)

Types

type LocksResolver

type LocksResolver struct{}

func (*LocksResolver) ExpiresAt

func (r *LocksResolver) ExpiresAt(ctx context.Context,
	obj *model.Lock) (*library.Datetime, error)

-------------------------- gcp general resolver --------------------------

type MutationResolver

type MutationResolver struct{}

func (*MutationResolver) AcquireLock

func (r *MutationResolver) AcquireLock(ctx context.Context,
	lockName string,
	durationSec int,
	isRenewal *bool,
) (ok bool, err error)

AcquireLock acquire mutex lock with name and duration. if `isRenewal=true`, will renewal exists lock.

func (*MutationResolver) CreateGeneralToken

func (r *MutationResolver) CreateGeneralToken(ctx context.Context,
	username string,
	durationSec int,
) (token string, err error)

CreateGeneralToken generate genaral token than should be set as cookie `general`

type QueryResolver

type QueryResolver struct{}

func (*QueryResolver) Lock

func (r *QueryResolver) Lock(ctx context.Context, name string) (*model.Lock, error)

func (*QueryResolver) LockPermissions

func (r *QueryResolver) LockPermissions(ctx context.Context, username string) (users []*global.GeneralUser, err error)

type Type

type Type struct {
	LocksResolver *LocksResolver
}
var Instance *Type

func New

func New() *Type

Jump to

Keyboard shortcuts

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