Packages

final case class H2Storage(xa: doobie.Transactor[IO]) extends ~>[StoreOp, IO] with Product with Serializable

Source
h2.scala
Linear Supertypes
Product, Equals, FunctionK[StoreOp, IO], Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. H2Storage
  2. Product
  3. Equals
  4. FunctionK
  5. Serializable
  6. Serializable
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new H2Storage(xa: doobie.Transactor[IO])

Type Members

  1. type AuditRow = (ID, Instant, Option[Long], String, String, String, Option[String])
  2. type BlueprintRow = (GUID, String, Option[String], Option[Sha256], Long, String, Instant)
  3. type DeploymentRow = (ID, ID, ID, String, Instant, WorkflowRef, PlanRef, GUID, ExpirationPolicyRef, Option[String])
  4. type DeploymentWithStatusRow = (ID, ID, ID, String, Instant, WorkflowRef, PlanRef, GUID, ExpirationPolicyRef, Option[String], DeploymentStatusString)
  5. type LoadbalancerRow = (ID, ID, String, ID, String, MajorVersion, Instant, GUID, String)
  6. case class ReleaseRow(slug: Slug, version: Version, timestamp: Instant, releaseId: Long, releaseHtmlUrl: URI, unitName: String, namespace: String, hash: String, deployid: Long, deployTimestamp: Instant, deployStatus: DeploymentStatus, deployGuid: GUID) extends Product with Serializable
  7. type ReleaseTuple = (String, String, Instant, Option[Long], Option[String], Option[String], String, String, Long, Instant, Option[String], GUID)
  8. type RouteRow = (Int, String, String, String, String)

Value Members

  1. def addUnit(vunit: @@[UnitDef, Versioned], repo_id: ID): doobie.ConnectionIO[Unit]
  2. def and[H[_]](h: FunctionK[StoreOp, H]): FunctionK[StoreOp, [γ$4$]Tuple2K[IO, H, γ$4$]]
    Definition Classes
    FunctionK
  3. def andThen[H[_]](f: FunctionK[IO, H]): FunctionK[StoreOp, H]
    Definition Classes
    FunctionK
  4. def apply[A](s: StoreOp[A]): IO[A]
    Definition Classes
    H2Storage → FunctionK
  5. def audit[A](event: AuditEvent[A]): doobie.ConnectionIO[ID]
  6. def auditLogFromRow(row: AuditRow): AuditLog
  7. def compose[E[_]](f: FunctionK[E, StoreOp]): FunctionK[E, IO]
    Definition Classes
    FunctionK
  8. def countDeploymentsByStatus(since: Long): doobie.ConnectionIO[List[(String, Int)]]
  9. def createDatacenter(dc: Datacenter): doobie.ConnectionIO[Unit]
  10. def createDeployment(unitId: ID, hash: String, namespace: Namespace, wf: WorkflowRef, plan: PlanRef, expPolicy: String): doobie.ConnectionIO[ID]

  11. def createDeploymentExpiration(id: ID, exp: Instant): doobie.ConnectionIO[ID]
  12. def createDeploymentResource(deploymentId: ID, name: String, uri: URI): doobie.ConnectionIO[ID]
  13. def createDeploymentStatus(id: ID, status: DeploymentStatus, msg: Option[String]): doobie.ConnectionIO[Unit]

  14. def createManualDeployment(datacenter: Datacenter, namespace: NamespaceName, serviceType: String, version: String, hash: String, description: String, port: Int, exp: Instant): doobie.ConnectionIO[GUID]
  15. def createNamespace(dc: String, name: NamespaceName): doobie.ConnectionIO[ID]

    datacenter is the primary key and here acts as a forigen key for namespaces.

    datacenter is the primary key and here acts as a forigen key for namespaces. We never want two datacenters with the same name.

  16. def createRelease(r: DeploymentEvent): doobie.ConnectionIO[Unit]

  17. def createTrafficShift(nsid: ID, to: Deployment, policy: TrafficShiftPolicy, dur: FiniteDuration): doobie.ConnectionIO[ID]
  18. def deleteAndThenCreateExpiration(id: ID, exp: Instant): doobie.ConnectionIO[ID]
  19. def deleteExpirations(id: ID): doobie.ConnectionIO[Int]
  20. def deleteLoadbalancerDeployment(lbid: ID): doobie.ConnectionIO[Int]
  21. def deleteRepositories(repos: NonEmptyList[Repo]): doobie.ConnectionIO[Unit]
  22. def deploymentFromRow(row: DeploymentRow): doobie.ConnectionIO[Deployment]
  23. def deploymentWithStatusFromRow(row: DeploymentWithStatusRow): doobie.ConnectionIO[(Deployment, DeploymentStatus)]
  24. def fetchDeployments(sql: doobie.ConnectionIO[List[DeploymentRow]]): doobie.ConnectionIO[Set[Deployment]]
  25. def fetchDeploymentsWithStatuses(sql: doobie.ConnectionIO[List[DeploymentWithStatusRow]]): doobie.ConnectionIO[Set[(Deployment, DeploymentStatus)]]
  26. def findBlueprint(name: String, revision: Revision): doobie.ConnectionIO[Option[Blueprint]]

    Use cases exist for fetching a single, discrete revision of a blueprint and also generically fetching whatever the latest might be.

    Use cases exist for fetching a single, discrete revision of a blueprint and also generically fetching whatever the latest might be. In this way, we funnel all that through a single function that either uses a different constraint to get a single record, or in the latter case, sorts by descending revision and picks the head record.

  27. def findDeployment(stackName: StackName): doobie.ConnectionIO[Option[Deployment]]
  28. def findDeploymentExpiration(id: ID): doobie.ConnectionIO[Option[Instant]]
  29. def findLastReleaseDeploymentStatus(r: Slug, u: UnitName): doobie.ConnectionIO[Option[DeploymentStatus]]

  30. def findLoadbalancerDeployment(name: String, v: MajorVersion, nsid: ID): doobie.ConnectionIO[Option[LoadbalancerDeployment]]
  31. def findRelease(id: Long): doobie.ConnectionIO[SortedMap[Released, List[ReleasedDeployment]]]

  32. def findReleaseByDeploymentGuid(guid: GUID): doobie.ConnectionIO[Option[(Released, ReleasedDeployment)]]

    Given a deployment ID, find all the associated gubbins.

  33. def findReleasedByUnitNameAndVersion(un: UnitName, v: Version): doobie.ConnectionIO[Option[Released]]
  34. def findRepository(u: User, slug: Slug): doobie.ConnectionIO[Option[Repo]]

    Fetch a single repository based on the supplied slug.

  35. def getCurrentTargetForServiceName(ns: ID, sn: ServiceName): doobie.ConnectionIO[Option[Target]]

    This will first try to find a traffic shift, if none is found, it will try to find the latest matching deployment

  36. def getDeployment(id: ID): doobie.ConnectionIO[Deployment]
  37. def getDeploymentByGuid(guid: GUID): doobie.ConnectionIO[Option[Deployment]]
  38. def getDeploymentResources(id: ID): doobie.ConnectionIO[Set[(String, URI)]]
  39. def getDeploymentStatus(id: ID): doobie.ConnectionIO[Option[DeploymentStatus]]
  40. def getDeploymentsForServiceNameByStatus(sn: ServiceName, ns: ID, status: NonEmptyList[DeploymentStatus]): doobie.ConnectionIO[List[Deployment]]
  41. def getLatestReleaseForLoadbalancer(name: String, mv: MajorVersion): doobie.ConnectionIO[Option[Released]]
  42. def getLoadbalancer(name: String, v: MajorVersion): doobie.ConnectionIO[Option[DCLoadbalancer]]
  43. def getLoadbalancerDeployment(id: ID): doobie.ConnectionIO[Option[LoadbalancerDeployment]]
  44. def getLoadbalancerDeploymentByGUID(guid: GUID): doobie.ConnectionIO[Option[LoadbalancerDeployment]]
  45. def getLoadbalancerRoutes(id: ID): doobie.ConnectionIO[Vector[Route]]
  46. def getMostAndLeastDeployed(since: Long, number: Int, sortOrder: String): doobie.ConnectionIO[List[(String, Int)]]
  47. def getNamespace(dc: String, nsName: NamespaceName): doobie.ConnectionIO[Option[Namespace]]
  48. def getNamespaceByID(id: ID): doobie.ConnectionIO[Namespace]
  49. def getTrafficShiftForServiceName(ns: ID, sn: ServiceName): doobie.ConnectionIO[Option[TrafficShift]]
  50. def getUnit(name: String, version: Version): doobie.ConnectionIO[Option[DCUnit]]
  51. def getUnitById(id: ID): doobie.ConnectionIO[DCUnit]
  52. def getUnitDependencies(id: ID): doobie.ConnectionIO[Set[ServiceName]]
  53. def getUnitResources(id: ID): doobie.ConnectionIO[Set[String]]
  54. def insertBlueprint(name: String, description: Option[String], sha256: Sha256, template: String): doobie.ConnectionIO[ID]
  55. def insertLoadbalancer(lb: Loadbalancer, version: MajorVersion, repoId: ID): doobie.ConnectionIO[ID]
  56. def insertLoadbalancerDeployment(lbid: ID, nsid: ID, hash: String, address: String): doobie.ConnectionIO[ID]
  57. def insertLoadbalancerIfAbsent(lbv: @@[Loadbalancer, Versioned], repoId: ID): doobie.ConnectionIO[ID]
  58. def insertOrUpdateRepositories(list: List[Repo]): doobie.ConnectionIO[Unit]

    Does what it says on the function.

  59. def killRelease(slug: Slug, version: String): doobie.ConnectionIO[Either[Throwable, Unit]]
  60. def linkRepositoriesToUser(list: List[Repo], u: User): doobie.ConnectionIO[Unit]

    Given a set of repositories, associate them with a specific user.

    Given a set of repositories, associate them with a specific user. This is used when we are syncing repositories at the behence of a user.

  61. def listAuditLog(limit: Long, offset: Long, action: Option[String], category: Option[String]): doobie.ConnectionIO[List[AuditLog]]
  62. def listAuditLogByReleaseId(limit: Long, offset: Long, releaseId: Long): doobie.ConnectionIO[List[AuditLog]]
  63. val listBlueprints: doobie.ConnectionIO[List[Blueprint]]

    Fetches the latest blueprint revision for every known blueprint.

    Fetches the latest blueprint revision for every known blueprint. The idea here is to provide insight into what blueprints exist in the system; given we have the inspection API for checking specific revisions, simply showing what's available and a pointer to the latest revision, should be informative enough.

  64. def listDatacenters: doobie.ConnectionIO[Set[String]]
  65. def listDeploymentStatuses(id: ID): doobie.ConnectionIO[List[(DeploymentStatus, Option[StatusMessage], Instant)]]

  66. def listDeploymentsForDatacenter(dc: String): doobie.ConnectionIO[Set[Deployment]]

  67. def listDeploymentsForNamespaceByStatus(ns: ID, stats: NonEmptyList[DeploymentStatus], unit: Option[UnitName] = None): doobie.ConnectionIO[Set[(Deployment, DeploymentStatus)]]
  68. def listDeploymentsForUnitByStatus(nsid: ID, name: UnitName, stats: NonEmptyList[DeploymentStatus]): doobie.ConnectionIO[Set[Deployment]]

  69. def listLoadbalancerDeploymentsForNamespace(nsid: ID): doobie.ConnectionIO[Vector[LoadbalancerDeployment]]
  70. def listNamespacesForDatacenter(dc: String): doobie.ConnectionIO[Set[Namespace]]
  71. def listRecentReleasesForRepository(slug: Slug): doobie.ConnectionIO[SortedMap[Released, List[ReleasedDeployment]]]

  72. def listReleases(limit: Int): doobie.ConnectionIO[SortedMap[Released, List[ReleasedDeployment]]]

  73. def listRepositories(u: User): doobie.ConnectionIO[List[Repo]]

    Fetch all repositories for a given user.

  74. def listRepositoriesWithActiveHooks(u: User): doobie.ConnectionIO[List[Repo]]

    List all the repositories the user has access too that have webhooks enabled.

  75. def listRepositoriesWithOwner(u: User, owner: String): doobie.ConnectionIO[List[Repo]]

    Fetch all repositories for a given owner, that the specified user has access too.

  76. def listShiftableDeployments(unit: UnitDef, ns: ID): doobie.ConnectionIO[List[Deployment]]
  77. def listUnitsByStatus(nsid: ID, statuses: NonEmptyList[DeploymentStatus]): doobie.ConnectionIO[Vector[(GUID, ServiceName)]]
  78. val log: Logger
  79. implicit val metaFeatureVersion: doobie.Meta[FeatureVersion]
  80. implicit val metaFiniteDuration: doobie.Meta[FiniteDuration]
  81. implicit val metaInstant: doobie.Meta[Instant]
  82. implicit val metaMajorVersion: doobie.Meta[MajorVersion]
  83. implicit val metaVersion: doobie.Meta[Version]
  84. implicit val namespaceName: doobie.Meta[NamespaceName]
  85. def or[H[_]](h: FunctionK[H, IO]): FunctionK[[γ$1$]EitherK[StoreOp, H, γ$1$], IO]
    Definition Classes
    FunctionK
  86. def reverseTrafficShift(toID: ID, rev: Instant): doobie.ConnectionIO[Option[ID]]
  87. def rowToReleased(row: (String, String, Instant, Long, String)): Option[Released]
  88. def startTrafficShift(from: ID, to: ID, st: Instant): doobie.ConnectionIO[Option[ID]]
  89. def unitDependencies(id: ID): doobie.ConnectionIO[Set[ServiceName]]
  90. def unitPorts(id: ID): doobie.ConnectionIO[Set[Port]]
  91. def updateDeploymentBlueprint(id: ID, bp: Option[RenderedBlueprint]): doobie.ConnectionIO[Unit]

    update the renderedBlueprint field of a deployment.

    update the renderedBlueprint field of a deployment. This is not a generalized update on Deployment as that would lead to wider mutabiltiy, which is highly discouraged.

  92. def verifyDeployable(dcName: String, ns: NamespaceName, unit: UnitDef): doobie.ConnectionIO[ValidatedNel[NelsonError, Unit]]
  93. val xa: doobie.Transactor[IO]