-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrades, some prep for scala 3 and remove cats-tagless dependency
- Loading branch information
jbwheatley
committed
Apr 26, 2021
1 parent
6debbe3
commit 8e51ee8
Showing
10 changed files
with
212 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
core/src/main/scala/dev/profunktor/fs2rabbit/algebra/BindingOps.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright 2017-2020 ProfunKtor | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.profunktor.fs2rabbit.algebra | ||
|
||
import cats.~> | ||
import dev.profunktor.fs2rabbit.model._ | ||
|
||
private[fs2rabbit] final class BindingOps[F[_]](val binding: Binding[F]) extends AnyVal { | ||
def mapK[G[_]](fK: F ~> G): Binding[G] = new Binding[G] { | ||
def bindQueue( | ||
channel: AMQPChannel, | ||
queueName: QueueName, | ||
exchangeName: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: QueueBindingArgs | ||
): G[Unit] = | ||
fK(binding.bindQueue(channel, queueName, exchangeName, routingKey, args)) | ||
|
||
def bindQueueNoWait( | ||
channel: AMQPChannel, | ||
queueName: QueueName, | ||
exchangeName: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: QueueBindingArgs | ||
): G[Unit] = | ||
fK(binding.bindQueueNoWait(channel, queueName, exchangeName, routingKey, args)) | ||
|
||
def unbindQueue( | ||
channel: AMQPChannel, | ||
queueName: QueueName, | ||
exchangeName: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: QueueUnbindArgs | ||
): G[Unit] = | ||
fK(binding.unbindQueue(channel, queueName, exchangeName, routingKey, args)) | ||
|
||
def bindExchange( | ||
channel: AMQPChannel, | ||
destination: ExchangeName, | ||
source: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: ExchangeBindingArgs | ||
): G[Unit] = | ||
fK(binding.bindExchange(channel, destination, source, routingKey, args)) | ||
|
||
def bindExchangeNoWait( | ||
channel: AMQPChannel, | ||
destination: ExchangeName, | ||
source: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: ExchangeBindingArgs | ||
): G[Unit] = | ||
fK(binding.bindExchangeNoWait(channel, destination, source, routingKey, args)) | ||
|
||
def unbindExchange( | ||
channel: AMQPChannel, | ||
destination: ExchangeName, | ||
source: ExchangeName, | ||
routingKey: RoutingKey, | ||
args: ExchangeUnbindArgs | ||
): G[Unit] = | ||
fK(binding.unbindExchange(channel, destination, source, routingKey, args)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
core/src/main/scala/dev/profunktor/fs2rabbit/algebra/DeclarationOps.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2017-2020 ProfunKtor | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.profunktor.fs2rabbit.algebra | ||
|
||
import cats.~> | ||
import dev.profunktor.fs2rabbit.config.declaration.{DeclarationExchangeConfig, DeclarationQueueConfig} | ||
import dev.profunktor.fs2rabbit.model._ | ||
|
||
private[fs2rabbit] final class DeclarationOps[F[_]](val declaration: Declaration[F]) extends AnyVal { | ||
def mapK[G[_]](fK: F ~> G): Declaration[G] = new Declaration[G] { | ||
def declareExchange(channel: AMQPChannel, exchangeConfig: DeclarationExchangeConfig): G[Unit] = | ||
fK(declaration.declareExchange(channel, exchangeConfig)) | ||
|
||
def declareExchangeNoWait(value: AMQPChannel, exchangeConfig: DeclarationExchangeConfig): G[Unit] = | ||
fK(declaration.declareExchangeNoWait(value, exchangeConfig)) | ||
|
||
def declareExchangePassive(channel: AMQPChannel, exchangeName: ExchangeName): G[Unit] = | ||
fK(declaration.declareExchangePassive(channel, exchangeName)) | ||
|
||
def declareQueue(channel: AMQPChannel): G[QueueName] = | ||
fK(declaration.declareQueue(channel)) | ||
|
||
def declareQueue(channel: AMQPChannel, queueConfig: DeclarationQueueConfig): G[Unit] = | ||
fK(declaration.declareQueue(channel, queueConfig)) | ||
|
||
def declareQueueNoWait(channel: AMQPChannel, queueConfig: DeclarationQueueConfig): G[Unit] = | ||
fK(declaration.declareQueueNoWait(channel, queueConfig)) | ||
|
||
def declareQueuePassive(channel: AMQPChannel, queueName: QueueName): G[Unit] = | ||
fK(declaration.declareQueuePassive(channel, queueName)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
core/src/main/scala/dev/profunktor/fs2rabbit/algebra/DeletionOps.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2017-2020 ProfunKtor | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.profunktor.fs2rabbit.algebra | ||
|
||
import cats.~> | ||
import dev.profunktor.fs2rabbit.config.deletion._ | ||
import dev.profunktor.fs2rabbit.model._ | ||
|
||
private[fs2rabbit] final class DeletionOps[F[_]](val deletion: Deletion[F]) extends AnyVal { | ||
def mapK[G[_]](fK: F ~> G): Deletion[G] = new Deletion[G] { | ||
def deleteQueue(channel: AMQPChannel, config: DeletionQueueConfig): G[Unit] = | ||
fK(deletion.deleteQueue(channel, config)) | ||
|
||
def deleteQueueNoWait(channel: AMQPChannel, config: DeletionQueueConfig): G[Unit] = | ||
fK(deletion.deleteQueueNoWait(channel, config)) | ||
|
||
def deleteExchange(channel: AMQPChannel, config: DeletionExchangeConfig): G[Unit] = | ||
fK(deletion.deleteExchange(channel, config)) | ||
|
||
def deleteExchangeNoWait(channel: AMQPChannel, config: DeletionExchangeConfig): G[Unit] = | ||
fK(deletion.deleteExchangeNoWait(channel, config)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.4.9 | ||
sbt.version=1.5.1 |