handler

package
v0.101.5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package handler implements service handlers. Handlers are not bound to a specific server transport like http or nats, instead they take a context and a request proto buf as inputs. http and other transports.

New handler constructors are expected to take in dependencies provided by other packages like connected database clients, loggers, tracers, etc...

Index

Constants

View Source
const BareForm = `` /* 21812-byte string literal not displayed */
View Source
const Model = `{"model":{}}`

Variables

This section is empty.

Functions

func OrganizationToRPC

func OrganizationToRPC(org *ent.Organization) *holos.Organization

OrganizationToRPC returns an *holos.Organization adapted from *ent.Organization u.

func PlatformToRPC

func PlatformToRPC(entity *ent.Platform) *platform.Platform

func UserToRPC

func UserToRPC(entity *ent.User) *holos.User

UserToRPC returns an *holos.User adapted from *ent.User u.

func WithTx

func WithTx(ctx context.Context, client *ent.Client, fn func(tx *ent.Tx) error) error

WithTx runs callbacks in a transaction as described in https://entgo.io/docs/transactions/#best-practices

Types

type OrganizationHandler

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

OrganizationHandler implements the OrganizationService interface.

func NewOrganizationHandler

func NewOrganizationHandler(db *ent.Client) *OrganizationHandler

NewOrganizationHandler returns a new OrganizationService implementation.

type PlatformHandler

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

PlatformHandler implements the PlatformService interface.

func NewPlatformHandler

func NewPlatformHandler(db *ent.Client) *PlatformHandler

NewPlatformHandler returns a new PlatformService implementation.

func (*PlatformHandler) CreatePlatform

CreatePlatform implements the PlatformService CreatePlatform rpc method.

func (*PlatformHandler) DeletePlatform added in v0.90.0

func (*PlatformHandler) GetPlatform

GetPlatform implements the PlatformService GetPlatform rpc method.

func (*PlatformHandler) ListPlatforms

ListPlatforms implements the PlatformService ListPlatforms rpc method.

type SystemHandler

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

SystemHandler implements the PlatformService interface.

func NewSystemHandler

func NewSystemHandler(db *ent.Client) *SystemHandler

NewSystemHandler returns a new SystemService implementation.

type UserHandler

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

UserHandler implements the UserService interface.

func NewUserHandler

func NewUserHandler(db *ent.Client) *UserHandler

NewUserHandler returns a new UserService implementation.

Jump to

Keyboard shortcuts

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