files

package
v0.0.0-...-c7f2103 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeListSomeEndpoint

func MakeListSomeEndpoint(component Component) endpoint.Endpoint

MakeListSomeEndpoint makes the ListSomeEndpoint.

Types

type Component

type Component interface {
	ListAll(context.Context) ([]File, error)
	ListSome(context.Context, int32, int32) ([]File, error)
	Count(context.Context) (int32, error)
}

Component is the files business component interface.

func NewComponent

func NewComponent(module Module) Component

NewComponent returns a files business component

type Database

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

Database deals with the communication with CockroachDB.

func InitDatabase

func InitDatabase(db cockroachDB) (*Database, error)

InitDatabase initializes the database

func (*Database) Count

func (c *Database) Count() (int32, error)

Count count all the rows from the database

func (*Database) ReadFromDb

func (c *Database) ReadFromDb(first int32, count int32) ([]File, error)

ReadFromDb returns all the files from the database

type Endpoints

type Endpoints struct {
	ListSomeEndpoint endpoint.Endpoint
}

Endpoints wraps a service behind a set of endpoints.

type File

type File struct {
	ID               int32  `json:"id,omitempty"`
	PatientAVSNumber string `json:"patientAvsNumber,omitempty"`
	DoctorID         int32  `json:"doctorId"`
	Data             string `json:"data"`
}

File represents a patient file

type Module

type Module interface {
	ListAll(ctx context.Context) ([]File, error)
	ListSome(ctx context.Context, first int32, rows int32) ([]File, error)
	Count(ctx context.Context) (int32, error)
}

Module contains the business logic for the files.

func NewModule

func NewModule(database Database) Module

NewModule returns a files module

type Page

type Page struct {
	Count int32  `json:"count"`
	Data  []File `json:"data"`
}

Page contains a page of File[] with the total count

Jump to

Keyboard shortcuts

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