Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

WIP: Add FtpConnector #105

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

kevchuang
Copy link
Contributor

@kevchuang kevchuang commented Oct 28, 2022

PR for #80

# Conflicts:
#	build.sbt
#	connectors/ftp-connector/src/main/scala/zio/connect/ftp/FtpConnector.scala
#	connectors/ftp-connector/src/main/scala/zio/connect/ftp/LiveFtpConnector.scala
#	connectors/ftp-connector/src/test/scala/zio/connect/ftp/FtpConnectorSpec.scala
#	connectors/ftp-connector/src/test/scala/zio/connect/ftp/LiveFtpConnectorSpec.scala
@CLAassistant
Copy link

CLAassistant commented Oct 28, 2022

CLA assistant check
All committers have signed the CLA.

@kevchuang kevchuang changed the title Add FtpConnector WIP: Add FtpConnector Oct 28, 2022
FtpDependencies.testContainersScala,
`zio`,
`zio-streams`,
`zio-prelude`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move zio-prelude to FtpDependencies please. While it's an RC version I would like to avoid putting it in the core dependencies.


def lsDescendant(path: => PathName): ZStream[Any, IOException, FtpResource]

def readFile(path: => PathName, chunkSize: Int = 2048)(implicit trace: Trace): ZStream[Any, IOException, Byte]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def readFile(path: => PathName, chunkSize: Int = 2048)(implicit trace: Trace): ZStream[Any, IOException, Byte]
def readFile(path: => PathName, chunkSize: => Int = 2048)(implicit trace: Trace): ZStream[Any, IOException, Byte]


import java.io.IOException

trait FtpConnector {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ordered alphabetically


import java.io.IOException

trait FtpConnectorSpec extends ZIOSpecDefault {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suites should be ordered alphabetically in implementation and in the composed result

zio.connect.ftp.ftpConnectorLiveLayer
)

val ftpContainer: ZLayer[Scope, Throwable, FixedHostPortGenericContainer] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val ftpContainer: ZLayer[Scope, Throwable, FixedHostPortGenericContainer] =
val ftpContainer: ZLayer[Any, Throwable, FixedHostPortGenericContainer] =

)

val ftpContainer: ZLayer[Scope, Throwable, FixedHostPortGenericContainer] =
ZLayer.fromZIO(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ZLayer.fromZIO(
ZLayer.scoped(

})(f => ZIO.attempt(f.stop()).orDie)
)

lazy val ftpLayer: ZLayer[Scope & FixedHostPortGenericContainer, ConnectionError, Ftp] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lazy val ftpLayer: ZLayer[Scope & FixedHostPortGenericContainer, ConnectionError, Ftp] =
lazy val ftpLayer: ZLayer[FixedHostPortGenericContainer, ConnectionError, Ftp] =


lazy val ftpLayer: ZLayer[Scope & FixedHostPortGenericContainer, ConnectionError, Ftp] =
ZLayer
.fromZIO (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.fromZIO (
.scoped (

val zio = "dev.zio" %% "zio" % zioVersion
val `zio-streams` = "dev.zio" %% "zio-streams" % zioVersion
val `zio-prelude` = "dev.zio" %% "zio-prelude" % zioPreludeVersion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moved to the ftp dependencies. While it's RC I would like to keep it out of core dependencies.

@@ -0,0 +1,16 @@
import sbt._

object FtpDependencies {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs ordering

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants