rpcserver

package
v0.0.0-...-72e33f6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const Route = "/twirp"

Variables

This section is empty.

Functions

func Logger

func Logger() twirp.ServerOption

func RequireAdminAuthSession

func RequireAdminAuthSession() twirp.ServerOption

RequireAuthSession allows only valid admin sessions.

func RequireAuthSession

func RequireAuthSession() twirp.ServerOption

RequireAuthSession allows only valid sessions.

Types

type Admin

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

func NewAdmin

func NewAdmin(db sqlite.DB) *Admin

func (*Admin) CreateDevice

func (a *Admin) CreateDevice(ctx context.Context, req *rpc.CreateDeviceReq) (*rpc.CreateDeviceResp, error)

func (*Admin) CreateEventRule

func (a *Admin) CreateEventRule(ctx context.Context, req *rpc.CreateEventRuleReq) (*rpc.CreateEventRuleResp, error)

func (*Admin) CreateGroup

func (a *Admin) CreateGroup(ctx context.Context, req *rpc.CreateGroupReq) (*rpc.CreateGroupResp, error)

func (*Admin) CreateUser

func (a *Admin) CreateUser(ctx context.Context, req *rpc.CreateUserReq) (*emptypb.Empty, error)

func (*Admin) DeleteDevice

func (a *Admin) DeleteDevice(ctx context.Context, req *rpc.DeleteDeviceReq) (*emptypb.Empty, error)

func (*Admin) DeleteEventRules

func (a *Admin) DeleteEventRules(ctx context.Context, req *rpc.DeleteEventRulesReq) (*emptypb.Empty, error)

func (*Admin) DeleteEvents

func (a *Admin) DeleteEvents(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)

func (*Admin) DeleteGroup

func (a *Admin) DeleteGroup(ctx context.Context, req *rpc.DeleteGroupReq) (*emptypb.Empty, error)

func (*Admin) DeleteUser

func (a *Admin) DeleteUser(ctx context.Context, req *rpc.DeleteUserReq) (*emptypb.Empty, error)

func (*Admin) GetAdminDevicesIDPage

func (a *Admin) GetAdminDevicesIDPage(ctx context.Context, req *rpc.GetAdminDevicesIDPageReq) (*rpc.GetAdminDevicesIDPageResp, error)

func (*Admin) GetAdminDevicesPage

func (a *Admin) GetAdminDevicesPage(ctx context.Context, req *rpc.GetAdminDevicesPageReq) (*rpc.GetAdminDevicesPageResp, error)

func (*Admin) GetAdminEventsPage

func (a *Admin) GetAdminEventsPage(ctx context.Context, _ *emptypb.Empty) (*rpc.GetAdminEventsPageResp, error)

func (*Admin) GetAdminGroupsIDPage

func (a *Admin) GetAdminGroupsIDPage(ctx context.Context, req *rpc.GetAdminGroupsIDPageReq) (*rpc.GetAdminGroupsIDPageResp, error)

func (*Admin) GetAdminGroupsPage

func (a *Admin) GetAdminGroupsPage(ctx context.Context, req *rpc.GetAdminGroupsPageReq) (*rpc.GetAdminGroupsPageResp, error)

func (*Admin) GetAdminUsersPage

func (a *Admin) GetAdminUsersPage(ctx context.Context, req *rpc.GetAdminUsersPageReq) (*rpc.GetAdminUsersPageResp, error)

func (*Admin) GetDevice

func (a *Admin) GetDevice(ctx context.Context, req *rpc.GetDeviceReq) (*rpc.GetDeviceResp, error)

func (*Admin) GetGroup

func (a *Admin) GetGroup(ctx context.Context, req *rpc.GetGroupReq) (*rpc.GetGroupResp, error)

func (*Admin) GetUser

func (a *Admin) GetUser(ctx context.Context, req *rpc.GetUserReq) (*rpc.GetUserResp, error)

func (*Admin) ListDeviceFeatures

func (*Admin) ListDeviceFeatures(context.Context, *emptypb.Empty) (*rpc.ListDeviceFeaturesResp, error)

func (*Admin) ListEventRules

func (a *Admin) ListEventRules(ctx context.Context, _ *emptypb.Empty) (*rpc.ListEventRulesResp, error)

func (*Admin) ListLocations

func (*Admin) ListLocations(context.Context, *emptypb.Empty) (*rpc.ListLocationsResp, error)

func (*Admin) ResetUserPassword

func (a *Admin) ResetUserPassword(ctx context.Context, req *rpc.ResetUserPasswordReq) (*emptypb.Empty, error)

func (*Admin) SetDeviceDisable

func (a *Admin) SetDeviceDisable(ctx context.Context, req *rpc.SetDeviceDisableReq) (*emptypb.Empty, error)

func (*Admin) SetGroupDisable

func (a *Admin) SetGroupDisable(ctx context.Context, req *rpc.SetGroupDisableReq) (*emptypb.Empty, error)

func (*Admin) SetUserAdmin

func (a *Admin) SetUserAdmin(ctx context.Context, req *rpc.SetUserAdminReq) (*emptypb.Empty, error)

func (*Admin) SetUserDisable

func (a *Admin) SetUserDisable(ctx context.Context, req *rpc.SetUserDisableReq) (*emptypb.Empty, error)

func (*Admin) UpdateConfig

func (a *Admin) UpdateConfig(cfg context.Context, req *rpc.UpdateConfigReq) (*emptypb.Empty, error)

func (*Admin) UpdateDevice

func (a *Admin) UpdateDevice(ctx context.Context, req *rpc.UpdateDeviceReq) (*emptypb.Empty, error)

func (*Admin) UpdateEventRule

func (a *Admin) UpdateEventRule(ctx context.Context, req *rpc.UpdateEventRuleReq) (*emptypb.Empty, error)

func (*Admin) UpdateGroup

func (a *Admin) UpdateGroup(ctx context.Context, req *rpc.UpdateGroupReq) (*emptypb.Empty, error)

func (*Admin) UpdateUser

func (a *Admin) UpdateUser(ctx context.Context, req *rpc.UpdateUserReq) (*emptypb.Empty, error)

type HelloWorld

type HelloWorld struct {
}

func (*HelloWorld) Hello

func (s *HelloWorld) Hello(ctx context.Context, req *rpc.HelloReq) (*rpc.HelloResp, error)

type Public

type Public struct {
}

func NewPublic

func NewPublic() *Public

func (*Public) ForgotPassword

func (*Public) ForgotPassword(context.Context, *rpc.ForgotPasswordReq) (*emptypb.Empty, error)

func (*Public) GetConfig

func (p *Public) GetConfig(context.Context, *emptypb.Empty) (*rpc.GetConfigResp, error)

func (*Public) SignUp

func (p *Public) SignUp(ctx context.Context, req *rpc.SignUpReq) (*emptypb.Empty, error)

type Server

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

func NewServer

func NewServer(e *echo.Echo) Server

func (Server) Register

func (s Server) Register(t TwirpHandler, middleware ...echo.MiddlewareFunc) Server

type TwirpHandler

type TwirpHandler interface {
	http.Handler
	PathPrefix() string
}

type User

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

func NewUser

func NewUser(mediamtxConfig mediamtx.Config) *User

func (*User) GetDeviceDetail

func (u *User) GetDeviceDetail(ctx context.Context, req *rpc.GetDeviceDetailReq) (*rpc.GetDeviceDetailResp, error)

func (*User) GetDeviceRPCStatus

func (u *User) GetDeviceRPCStatus(ctx context.Context, req *rpc.GetDeviceRPCStatusReq) (*rpc.GetDeviceRPCStatusResp, error)

func (*User) GetDeviceSoftwareVersion

func (u *User) GetDeviceSoftwareVersion(ctx context.Context, req *rpc.GetDeviceSoftwareVersionReq) (*rpc.GetDeviceSoftwareVersionResp, error)

func (*User) GetDeviceUptime

func (u *User) GetDeviceUptime(ctx context.Context, req *rpc.GetDeviceUptimeReq) (*rpc.GetDeviceUptimeResp, error)

func (*User) GetDevicesPage

func (u *User) GetDevicesPage(ctx context.Context, req *rpc.GetDevicesPageReq) (*rpc.GetDevicesPageResp, error)

func (*User) GetEmailsIDPage

func (u *User) GetEmailsIDPage(ctx context.Context, req *rpc.GetEmailsIDPageReq) (*rpc.GetEmailsIDPageResp, error)

func (*User) GetEmailsPage

func (u *User) GetEmailsPage(ctx context.Context, req *rpc.GetEmailsPageReq) (*rpc.GetEmailsPageResp, error)

func (*User) GetEventsPage

func (u *User) GetEventsPage(ctx context.Context, req *rpc.GetEventsPageReq) (*rpc.GetEventsPageResp, error)

func (*User) GetFileMonthCount

func (u *User) GetFileMonthCount(ctx context.Context, req *rpc.GetFileMonthCountReq) (*rpc.GetFileMonthCountResp, error)

func (*User) GetFilesPage

func (u *User) GetFilesPage(ctx context.Context, req *rpc.GetFilesPageReq) (*rpc.GetFilesPageResp, error)

func (*User) GetHomePage

func (u *User) GetHomePage(ctx context.Context, _ *emptypb.Empty) (*rpc.GetHomePageResp, error)

func (*User) GetProfilePage

func (u *User) GetProfilePage(ctx context.Context, _ *emptypb.Empty) (*rpc.GetProfilePageResp, error)

func (*User) ListDeviceLicenses

func (u *User) ListDeviceLicenses(ctx context.Context, req *rpc.ListDeviceLicensesReq) (*rpc.ListDeviceLicensesResp, error)

func (*User) ListDeviceStorage

func (u *User) ListDeviceStorage(ctx context.Context, req *rpc.ListDeviceStorageReq) (*rpc.ListDeviceStorageResp, error)

func (*User) ListDeviceStreams

func (u *User) ListDeviceStreams(ctx context.Context, req *rpc.ListDeviceStreamsReq) (*rpc.ListDeviceStreamsResp, error)

func (*User) ListDevices

func (u *User) ListDevices(ctx context.Context, _ *emptypb.Empty) (*rpc.ListDevicesResp, error)

func (*User) ListEmailAlarmEvents

func (u *User) ListEmailAlarmEvents(ctx context.Context, _ *emptypb.Empty) (*rpc.ListEmailAlarmEventsResp, error)

func (*User) ListEventFilters

func (u *User) ListEventFilters(ctx context.Context, _ *emptypb.Empty) (*rpc.ListEventFiltersResp, error)

func (*User) ListLatestFiles

func (u *User) ListLatestFiles(ctx context.Context, _ *emptypb.Empty) (*rpc.ListLatestFilesResp, error)

func (*User) RevokeAllMySessions

func (u *User) RevokeAllMySessions(ctx context.Context, rCreateUpdateGroupeq *emptypb.Empty) (*emptypb.Empty, error)

func (*User) RevokeMySession

func (u *User) RevokeMySession(ctx context.Context, req *rpc.RevokeMySessionReq) (*emptypb.Empty, error)

func (*User) UpdateMyPassword

func (u *User) UpdateMyPassword(ctx context.Context, req *rpc.UpdateMyPasswordReq) (*emptypb.Empty, error)

func (*User) UpdateMyUsername

func (u *User) UpdateMyUsername(ctx context.Context, req *rpc.UpdateMyUsernameReq) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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