Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBadRouting is returned when an expected path variable is missing, which is always programmer error. ErrBadRouting = fmt.Errorf("inconsistent mapping between route and handler, %s", bugReportHelp) ErrFoundABug = fmt.Errorf("Snuck into encodeError with err == nil, %s", bugReportHelp) )
View Source
var ( ErrNotFound = errors.New("Not Found") ErrAlreadyExists = errors.New("Already Exists") )
Functions ¶
func MakeHTTPHandler ¶
Types ¶
type Repository ¶
type Repository interface { StoreFile(file *ach.File) error FindFile(id string) (*ach.File, error) FindAllFiles() []*ach.File DeleteFile(id string) error StoreBatch(fileID string, batch ach.Batcher) error FindBatch(fileID string, batchID string) (ach.Batcher, error) FindAllBatches(fileID string) []ach.Batcher DeleteBatch(fileID string, batchID string) error }
Repository is the Service storage mechanism abstraction
func NewRepositoryInMemory ¶
func NewRepositoryInMemory() Repository
NewRepositoryInMemory is an in memory ach storage repository for files
type Service ¶
type Service interface { // CreateFile creates a new ach file record and returns a resource ID CreateFile(f *ach.FileHeader) (string, error) // AddFile retrieves a file based on the File id GetFile(id string) (*ach.File, error) // GetFiles retrieves all files accessible from the client. GetFiles() []*ach.File // DeleteFile takes a file resource ID and deletes it from the store DeleteFile(id string) error // GetFileContents creates a valid plaintext file in memory assuming it has a FileHeader and at least one Batch record. GetFileContents(id string) (io.Reader, error) // ValidateFile ValidateFile(id string) error // CreateBatch creates a new batch within and ach file and returns its resource ID CreateBatch(fileID string, bh ach.Batcher) (string, error) // GetBatch retrieves a batch based oin the file id and batch id GetBatch(fileID string, batchID string) (ach.Batcher, error) // GetBatches retrieves all batches associated with the file id. GetBatches(fileID string) []ach.Batcher // DeleteBatch takes a fileID and BatchID and removes the batch from the file DeleteBatch(fileID string, batchID string) error }
Service is a REST interface for interacting with ACH file structures TODO: Add ctx to function parameters to pass the client security token
Click to show internal directories.
Click to hide internal directories.