mediarpc

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the media gRPC client.

func NewClient

func NewClient(conn grpc.ClientConnInterface) *Client

NewClient returns the media gRPC client.

func (*Client) FetchGallery

func (c *Client) FetchGallery(ctx context.Context, id uuid.UUID) (gallery.JSONGallery, error)

func (*Client) FetchShelf

func (c *Client) FetchShelf(ctx context.Context, id uuid.UUID) (document.JSONShelf, error)

func (*Client) LookupGalleryByName

func (c *Client) LookupGalleryByName(ctx context.Context, name string) (uuid.UUID, bool, error)

func (*Client) LookupGalleryStackByName

func (c *Client) LookupGalleryStackByName(ctx context.Context, galleryID uuid.UUID, name string) (uuid.UUID, bool, error)

func (*Client) LookupShelfByName

func (c *Client) LookupShelfByName(ctx context.Context, name string) (uuid.UUID, bool, error)

LookupShelfByName looks up the UUID of a shelf by its name.

func (*Client) ReplaceDocument

func (c *Client) ReplaceDocument(ctx context.Context, shelfID, documentID uuid.UUID, r io.Reader) (document.Document, error)

ReplaceDocument replaces a document within a shelf.

func (*Client) ReplaceImage

func (c *Client) ReplaceImage(ctx context.Context, galleryID, stackID uuid.UUID, r io.Reader) (gallery.Stack, error)

func (*Client) UploadDocument

func (c *Client) UploadDocument(
	ctx context.Context,
	shelfID uuid.UUID,
	r io.Reader,
	uniqueName, name, disk, path string,
) (document.Document, error)

UploadDocument uploads a document to a shelf.

func (*Client) UploadImage

func (c *Client) UploadImage(ctx context.Context, galleryID uuid.UUID, r io.Reader, name, disk, path string) (gallery.Stack, error)

type Server

type Server struct {
	protomedia.UnimplementedMediaServiceServer
	// contains filtered or unexported fields
}

Server is the media gRPC server.

func NewServer

func NewServer(
	shelfs document.Repository,
	docLookup *document.Lookup,
	galleries gallery.Repository,
	galleryLookup *gallery.Lookup,
	storage media.Storage,
) *Server

NewServer returns the media gRPC server.

func (*Server) FetchGallery

func (s *Server) FetchGallery(ctx context.Context, id *protocommon.UUID) (*protomedia.Gallery, error)

func (*Server) FetchShelf

func (s *Server) FetchShelf(ctx context.Context, id *protocommon.UUID) (*protomedia.Shelf, error)

func (*Server) LookupGalleryByName

func (s *Server) LookupGalleryByName(ctx context.Context, req *protocommon.NameLookup) (*protocommon.LookupResp, error)

func (*Server) LookupGalleryStackByName

func (s *Server) LookupGalleryStackByName(ctx context.Context, req *protomedia.LookupGalleryStackByNameReq) (*protocommon.LookupResp, error)

func (*Server) LookupShelfByName

func (s *Server) LookupShelfByName(ctx context.Context, req *protocommon.NameLookup) (*protocommon.LookupResp, error)

LookupShelfByName looks up the UUID of a shelf by its name.

func (*Server) Register

func (s *Server) Register(reg grpc.ServiceRegistrar)

Register registers the server into a ServiceRegistrar.

func (*Server) ReplaceDocument

func (s *Server) ReplaceDocument(stream protomedia.MediaService_ReplaceDocumentServer) error

ReplaceDocument replaces a document within a shelf.

func (*Server) ReplaceImage

func (s *Server) ReplaceImage(stream protomedia.MediaService_ReplaceImageServer) error

func (*Server) UploadDocument

func (s *Server) UploadDocument(stream protomedia.MediaService_UploadDocumentServer) error

UploadDocument uploads a document to a shelf.

func (*Server) UploadImage

func (s *Server) UploadImage(stream protomedia.MediaService_UploadImageServer) error

Jump to

Keyboard shortcuts

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