package domain import "io" type BogFileService struct { user_agent_repo UserAgentRepository file_data_repo FileDataRepository } func (b *BogFileService) RecieveFile(src FileSource) error { f, err := b.file_data_repo.OpenOrCreate(src.Path(), src.UserAgent()) if err != nil { return err } io.Copy(f, src) return nil } func (b *BogFileService) SendFile(dst FileDestination) error { f, err := b.file_data_repo.OpenOrCreate(dst.Path(), dst.UserAgent()) if err != nil { return err } io.Copy(dst, f) return nil }