rpc

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package rpc is a gRPC API interface of the Fish node

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationService

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

ApplicationService implements the Application service

func (*ApplicationService) Create

Create creates a new application

func (*ApplicationService) CreateTask

CreateTask creates a new task for an application

func (*ApplicationService) Deallocate

Deallocate deallocates an application

func (*ApplicationService) Get

Get returns an application by UID

func (*ApplicationService) GetResource

GetResource returns the resource of an application

func (*ApplicationService) GetState

GetState returns the state of an application

func (*ApplicationService) GetTask

GetTask returns a specific task for an application

func (*ApplicationService) List

List returns a list of applications

func (*ApplicationService) ListResource

ListResource returns a list of applications

func (*ApplicationService) ListState

ListState returns a list of applications

func (*ApplicationService) ListTask

ListTask returns the list of tasks for an application

type AuthService

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

AuthService implements the authentication service

func NewAuthService

func NewAuthService(f *fish.Fish) *AuthService

NewAuthService creates a new auth service

func (*AuthService) GetPermissions

GetPermissions returns the current user's permissions

func (*AuthService) Login

Login authenticates a user and returns a JWT token

func (*AuthService) ParseJWTToken

func (s *AuthService) ParseJWTToken(tokenString string) (*JWTClaims, error)

ParseJWTToken parses a JWT token and returns the claims

func (*AuthService) RefreshToken

RefreshToken refreshes an existing JWT token

func (*AuthService) ValidateToken

ValidateToken validates a JWT token

type JWTClaims

type JWTClaims struct {
	UserName string   `json:"user_name"`
	Roles    []string `json:"roles"`
	jwt.RegisteredClaims
}

JWT claims structure

type LabelService

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

LabelService implements the Label service

func (*LabelService) Create

Create creates a new label

func (*LabelService) Get

Get returns a label by name

func (*LabelService) List

List returns a list of labels

func (*LabelService) Remove

Remove deletes a label

type NodeService

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

NodeService implements the Node service

func (*NodeService) Get

Get returns information about any node

func (*NodeService) GetThis

GetThis returns information about this node

func (*NodeService) List

List returns a list of nodes

func (*NodeService) SetMaintenance

SetMaintenance sets maintenance mode for this node

type RefreshTokenClaims

type RefreshTokenClaims struct {
	UserName string `json:"user_name"`
	jwt.RegisteredClaims
}

RefreshTokenClaims structure for refresh tokens

type RoleService

type RoleService struct {
	aquariumv2connect.UnimplementedRoleServiceHandler
	// contains filtered or unexported fields
}

RoleService implements the Role service

func (*RoleService) Create

Create implements the Create RPC

func (*RoleService) Get

Get implements the Get RPC

func (*RoleService) List

List implements the List RPC

func (*RoleService) Remove

Remove implements the Remove RPC

func (*RoleService) Update

Update implements the Update RPC

type Server

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

Server represents the Connect server

func NewServer

func NewServer(f *fish.Fish, additionalServices []gate.RPCService) *Server

NewServer creates a new Connect server

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the server's HTTP handler

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string, certFile, keyFile string) error

ListenAndServe starts the server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server and all streaming connections

type StreamingService

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

StreamingService implements the streaming service

func NewStreamingService

func NewStreamingService(f *fish.Fish) *StreamingService

NewStreamingService creates a new streaming service

func (*StreamingService) Connect

Connect handles bidirectional streaming for RPC requests

func (*StreamingService) GracefulShutdown

func (s *StreamingService) GracefulShutdown(ctx context.Context)

GracefulShutdown initiates graceful shutdown of all streaming connections

func (*StreamingService) Subscribe

Subscribe handles server streaming for database change notifications

type SubscriptionPermissionCache

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

SubscriptionPermissionCache manages user permissions for applications

func NewSubscriptionPermissionCache

func NewSubscriptionPermissionCache() *SubscriptionPermissionCache

NewSubscriptionPermissionCache creates a new permission cache

func (*SubscriptionPermissionCache) CleanupStaleEntries

func (spc *SubscriptionPermissionCache) CleanupStaleEntries(f *fish.Fish)

CleanupStaleEntries removes entries for applications that no longer exist

func (*SubscriptionPermissionCache) GrantAccess

func (spc *SubscriptionPermissionCache) GrantAccess(userName string, appUID typesv2.ApplicationUID)

GrantAccess grants a user access to an application UID

func (*SubscriptionPermissionCache) HasAccess

func (spc *SubscriptionPermissionCache) HasAccess(userName string, appUID typesv2.ApplicationUID) bool

HasAccess checks if a user has cached access to an application UID

func (*SubscriptionPermissionCache) RevokeAccess

func (spc *SubscriptionPermissionCache) RevokeAccess(userName string, appUID typesv2.ApplicationUID)

RevokeAccess removes a user's access to an application UID

type UserService

type UserService struct {
	aquariumv2connect.UnimplementedUserServiceHandler
	// contains filtered or unexported fields
}

UserService implements the User service

func (*UserService) Create

Create implements the Create RPC

func (*UserService) Get

Get implements the Get RPC

func (*UserService) GetMe

GetMe implements the GetMe RPC

func (*UserService) List

List implements the List RPC

func (*UserService) Remove

Remove implements the Remove RPC

func (*UserService) Update

Update implements the Update RPC

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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