authz

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceTypeUser = "user"

Variables

This section is empty.

Functions

func CreateHandler added in v0.11.0

func CreateHandler(svc UserService, w http.ResponseWriter, r *http.Request) error

func DeleteHandler added in v0.11.0

func DeleteHandler(svc UserService, w http.ResponseWriter, r *http.Request) error

func GetHandler added in v0.11.0

func GetHandler(svc UserService, w http.ResponseWriter, r *http.Request) error

func ListHandler added in v0.11.0

func ListHandler(svc UserService, w http.ResponseWriter, r *http.Request) error

func UpdateHandler added in v0.11.0

func UpdateHandler(svc UserService, w http.ResponseWriter, r *http.Request) error

Types

type UpdateUserSpec

type UpdateUserSpec struct {
	Email *string `json:"email"`
}

func (UpdateUserSpec) ToUpdateObjectSpec added in v0.36.0

func (updateSpec UpdateUserSpec) ToUpdateObjectSpec() *object.UpdateObjectSpec

type UserListParamParser

type UserListParamParser struct{}

func (UserListParamParser) GetDefaultSortBy

func (parser UserListParamParser) GetDefaultSortBy() string

func (UserListParamParser) GetSupportedSortBys

func (parser UserListParamParser) GetSupportedSortBys() []string

func (UserListParamParser) ParseValue

func (parser UserListParamParser) ParseValue(val string, sortBy string) (interface{}, error)

type UserService

type UserService struct {
	service.BaseService
	EventSvc  event.Service
	ObjectSvc *object.ObjectService
}

func NewService

func NewService(env service.Env, eventSvc event.Service, objectSvc *object.ObjectService) *UserService

func (UserService) Create

func (svc UserService) Create(ctx context.Context, userSpec UserSpec) (*UserSpec, error)

func (UserService) DeleteByUserId

func (svc UserService) DeleteByUserId(ctx context.Context, userId string) error

func (UserService) GetByUserId

func (svc UserService) GetByUserId(ctx context.Context, userId string) (*UserSpec, error)

func (UserService) List

func (svc UserService) List(ctx context.Context, listParams service.ListParams) ([]UserSpec, error)

func (UserService) Routes added in v0.8.0

func (svc UserService) Routes() ([]service.Route, error)

func (UserService) UpdateByUserId

func (svc UserService) UpdateByUserId(ctx context.Context, userId string, userSpec UpdateUserSpec) (*UserSpec, error)

type UserSpec

type UserSpec struct {
	UserId    string    `json:"userId" validate:"omitempty,valid_object_id"`
	Email     *string   `json:"email"`
	CreatedAt time.Time `json:"createdAt"`
}

func NewUserSpecFromObjectSpec added in v0.36.0

func NewUserSpecFromObjectSpec(objectSpec *object.ObjectSpec) (*UserSpec, error)

func (UserSpec) ToCreateObjectSpec added in v0.34.0

func (spec UserSpec) ToCreateObjectSpec() (*object.CreateObjectSpec, error)

Jump to

Keyboard shortcuts

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