go/twitterchiver: init

This commit is contained in:
Luke Granger-Brown 2020-10-04 01:07:59 +01:00
parent ededad92d0
commit dd3c58548d
9 changed files with 43 additions and 2 deletions

View file

@ -9,6 +9,11 @@ let
prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; }); prefixAttrs = prefix: lib.mapAttrsToList (name: value: { name = "${prefix}-${name}"; path = value; });
ciMachines = prefixAttrs "machine" depot.ops.nixos; ciMachines = prefixAttrs "machine" depot.ops.nixos;
ciPackages = prefixAttrs "pkg" depot.nix.pkgs; ciPackages = prefixAttrs "pkg" depot.nix.pkgs;
in
pkgs.linkFarm "ci" (ciMachines ++ ciPackages) ciOther = prefixAttrs "other" {
twitterchiver = depot.go.twitterchiver;
twitterchiverDocker = depot.go.twitterchiver.dockerImage;
};
in
pkgs.linkFarm "ci" (ciMachines ++ ciPackages ++ ciOther)

View file

@ -19,6 +19,7 @@ in fix (self:
ops = import ./ops ch; ops = import ./ops ch;
nix = import ./nix ch; nix = import ./nix ch;
web = import ./web ch; web = import ./web ch;
go = import ./go ch;
lib = self.third_party.nixpkgs.lib; lib = self.third_party.nixpkgs.lib;

7
go/default.nix Normal file
View file

@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
args: {
twitterchiver = import ./twitterchiver args;
}

View file

@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.13-buster as build FROM golang:1.13-buster as build
RUN mkdir /go/src/app RUN mkdir /go/src/app

View file

@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
//
// SPDX-License-Identifier: Apache-2.0
package main package main
import ( import (

View file

@ -1,3 +1,7 @@
-- SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
--
-- SPDX-License-Identifier: Apache-2.0
CREATE TABLE tweets ( CREATE TABLE tweets (
id BIGINT NOT NULL, id BIGINT NOT NULL,
text TEXT NOT NULL, text TEXT NOT NULL,

View file

@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, ... }: depot.third_party.buildGo.program {
name = "twitterchiver";
srcs = [ ./archiver/archiver.go ];
deps = [
depot.third_party.gopkgs."github.com".dghubble.oauth1
depot.third_party.gopkgs."github.com".jackc.pgx.v4
];
}

View file

@ -1,3 +1,7 @@
// SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
//
// SPDX-License-Identifier: Apache-2.0
module github.com/lukegb/twitterchiver module github.com/lukegb/twitterchiver
go 1.14 go 1.14

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
SPDX-License-Identifier: Apache-2.0