Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: rename clients

+83 -80
+18
agent/lib/sower_agent.ex
··· 1 + defmodule SowerAgent do 2 + @moduledoc """ 3 + Documentation for `SowerAgent`. 4 + """ 5 + 6 + @doc """ 7 + Hello world. 8 + 9 + ## Examples 10 + 11 + iex> SowerAgent.hello() 12 + :world 13 + 14 + """ 15 + def hello do 16 + :world 17 + end 18 + end
+8
agent/test/sower_agent_test.exs
··· 1 + defmodule SowerAgentTest do 2 + use ExUnit.Case 3 + doctest SowerAgent 4 + 5 + test "greets the world" do 6 + assert SowerAgent.hello() == :world 7 + end 8 + end
client-elixir/.formatter.exs agent/.formatter.exs
+1 -1
client-elixir/.gitignore agent/.gitignore
··· 17 17 *.ez 18 18 19 19 # Ignore package tarball (built via "mix hex.build"). 20 - sower_client-*.tar 20 + sower_agent-*.tar 21 21 22 22 # Temporary files, for example, from tests. 23 23 /tmp/
+4 -4
client-elixir/README.md agent/README.md
··· 1 - # SowerClient 1 + # SowerAgent 2 2 3 3 **TODO: Add description** 4 4 5 5 ## Installation 6 6 7 7 If [available in Hex](https://hex.pm/docs/publish), the package can be installed 8 - by adding `sower_client` to your list of dependencies in `mix.exs`: 8 + by adding `sower_agent` to your list of dependencies in `mix.exs`: 9 9 10 10 ```elixir 11 11 def deps do 12 12 [ 13 - {:sower_client, "~> 0.1.0"} 13 + {:sower_agent, "~> 0.1.0"} 14 14 ] 15 15 end 16 16 ``` 17 17 18 18 Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) 19 19 and published on [HexDocs](https://hexdocs.pm). Once published, the docs can 20 - be found at <https://hexdocs.pm/sower_client>. 20 + be found at <https://hexdocs.pm/sower_agent>. 21 21
client-elixir/config/config.exs agent/config/config.exs
+1 -1
client-elixir/config/dev.exs agent/config/dev.exs
··· 1 1 import Config 2 2 3 - config :sower_client, SowerClient.SocketClient, 3 + config :sower_agent, SowerAgent.SocketClient, 4 4 uri: "ws://localhost:7150/client/websocket", 5 5 reconnect_after_msec: [200, 500, 1_000, 2_000]
client-elixir/config/prod.exs agent/config/prod.exs
+1 -1
client-elixir/config/test.exs agent/config/test.exs
··· 1 1 import Config 2 2 3 - config :sower_client, SocketClient, 3 + config :sower_agent, SocketClient, 4 4 uri: "ws://example.org/socket/websocket", 5 5 reconnect_after_msec: [200, 500, 1_000, 2_000]
client-elixir/deps.nix agent/deps.nix
-18
client-elixir/lib/sower_client.ex
··· 1 - defmodule SowerClient do 2 - @moduledoc """ 3 - Documentation for `SowerClient`. 4 - """ 5 - 6 - @doc """ 7 - Hello world. 8 - 9 - ## Examples 10 - 11 - iex> SowerClient.hello() 12 - :world 13 - 14 - """ 15 - def hello do 16 - :world 17 - end 18 - end
+4 -4
client-elixir/lib/sower_client/application.ex agent/lib/sower_agent/application.ex
··· 1 - defmodule SowerClient.Application do 1 + defmodule SowerAgent.Application do 2 2 # See https://hexdocs.pm/elixir/Application.html 3 3 # for more information on OTP Applications 4 4 @moduledoc false ··· 8 8 @impl true 9 9 def start(_type, _args) do 10 10 children = [ 11 - # Starts a worker by calling: SowerClient.Worker.start_link(arg) 12 - {SowerClient.SocketClient, []} 11 + # Starts a worker by calling: SowerAgent.Worker.start_link(arg) 12 + {SowerAgent.SocketClient, []} 13 13 ] 14 14 15 15 # See https://hexdocs.pm/elixir/Supervisor.html 16 16 # for other strategies and supported options 17 - opts = [strategy: :one_for_one, name: SowerClient.Supervisor] 17 + opts = [strategy: :one_for_one, name: SowerAgent.Supervisor] 18 18 Supervisor.start_link(children, opts) 19 19 end 20 20 end
+2 -2
client-elixir/lib/sower_client/worker.ex agent/lib/sower_agent/worker.ex
··· 1 - defmodule SowerClient.SocketClient do 1 + defmodule SowerAgent.SocketClient do 2 2 use Slipstream 3 3 4 4 require Logger ··· 36 36 37 37 @impl Slipstream 38 38 def init(_args) do 39 - config = Application.fetch_env!(:sower_client, __MODULE__) 39 + config = Application.fetch_env!(:sower_agent, __MODULE__) 40 40 41 41 case connect(config) do 42 42 {:ok, socket} ->
+3 -3
client-elixir/mix.exs agent/mix.exs
··· 1 - defmodule SowerClient.MixProject do 1 + defmodule SowerAgent.MixProject do 2 2 use Mix.Project 3 3 4 4 def project do 5 5 [ 6 - app: :sower_client, 6 + app: :sower_agent, 7 7 version: "0.1.0", 8 8 elixir: "~> 1.18", 9 9 start_permanent: Mix.env() == :prod, ··· 15 15 def application do 16 16 [ 17 17 extra_applications: [:logger], 18 - mod: {SowerClient.Application, []} 18 + mod: {SowerAgent.Application, []} 19 19 ] 20 20 end 21 21
client-elixir/mix.lock agent/mix.lock
-8
client-elixir/test/sower_client_test.exs
··· 1 - defmodule SowerClientTest do 2 - use ExUnit.Case 3 - doctest SowerClient 4 - 5 - test "greets the world" do 6 - assert SowerClient.hello() == :world 7 - end 8 - end
client-elixir/test/test_helper.exs agent/test/test_helper.exs
client/client.gen.go client-go/client.gen.go
client/config.yaml client-go/config.yaml
+1 -1
client/end_to_end_test.go client-go/end_to_end_test.go
··· 6 6 "net/http" 7 7 "testing" 8 8 9 - "codeberg.org/adamcstephens/sower/client" 9 + "codeberg.org/adamcstephens/sower/client-go" 10 10 ) 11 11 12 12 // custom HTTP client
client/generate.go client-go/generate.go
client/seed_client.go client-go/seed_client.go
+1 -1
cmd/cli/main.go
··· 11 11 "strings" 12 12 "time" 13 13 14 - "codeberg.org/adamcstephens/sower/client" 14 + "codeberg.org/adamcstephens/sower/client-go" 15 15 "codeberg.org/adamcstephens/sower/cmd/cli/builder" 16 16 "github.com/adrg/xdg" 17 17 "github.com/alexflint/go-arg"
+1 -1
cmd/cli/seed.go
··· 8 8 "path/filepath" 9 9 "strings" 10 10 11 - "codeberg.org/adamcstephens/sower/client" 11 + "codeberg.org/adamcstephens/sower/client-go" 12 12 "codeberg.org/adamcstephens/sower/cmd/cli/commands" 13 13 ) 14 14
+1 -1
cmd/cli/services.go
··· 10 10 "os/exec" 11 11 "path/filepath" 12 12 13 - "codeberg.org/adamcstephens/sower/client" 13 + "codeberg.org/adamcstephens/sower/client-go" 14 14 "codeberg.org/adamcstephens/sower/cmd/cli/commands" 15 15 "github.com/adrg/xdg" 16 16 )
+1 -1
flake.nix
··· 113 113 inherit version; 114 114 }; 115 115 116 - client = pkgs.callPackage ./nix/packages/client.nix { 116 + agent = pkgs.callPackage ./nix/packages/agent.nix { 117 117 inherit beamPackages version; 118 118 }; 119 119
+4 -4
justfile
··· 36 36 37 37 mix-nix-lock: 38 38 mix deps.nix --output nix/packages/deps.nix 39 - cd client-elixir; mix deps.nix 39 + cd agent; mix deps.nix 40 40 41 41 mix-clean: 42 42 mix deps.clean --unused --unlock ··· 47 47 MIX_ENV=test mix openapi.spec.json --spec SowerWeb.ApiSpec --pretty=true openapi.json 48 48 49 49 openapi-generate: openapi-output 50 - go generate ./client 50 + go generate ./client-go 51 51 52 52 set-version: && openapi-generate 53 53 @echo "Current version: $(cat VERSION)" ··· 66 66 start: dev-services 67 67 iex -S mix phx.server 68 68 69 - [working-directory('client-elixir')] 70 - start-client: 69 + [working-directory('agent')] 70 + start-agent: 71 71 iex -S mix 72 72 73 73 start-pry:
+31
nix/packages/agent.nix
··· 1 + { 2 + beamPackages, 3 + callPackages, 4 + lib, 5 + version, 6 + }: 7 + 8 + beamPackages.mixRelease { 9 + pname = "sower-agent"; 10 + inherit version; 11 + 12 + src = lib.fileset.toSource { 13 + root = ../../agent; 14 + fileset = lib.fileset.unions [ 15 + ../../agent 16 + ]; 17 + }; 18 + 19 + mixNixDeps = callPackages ../../agent/deps.nix { 20 + inherit lib beamPackages; 21 + }; 22 + 23 + postInstall = '' 24 + mv $out/bin/sower_agent $out/bin/sower-agent 25 + ''; 26 + 27 + # Disable checks for now 28 + doCheck = false; 29 + 30 + meta.mainProgram = "sower-agent"; 31 + }
+1 -1
nix/packages/cli.nix
··· 19 19 toSource { 20 20 root = ../..; 21 21 fileset = unions [ 22 - ../../client 22 + ../../client-go 23 23 ../../cmd/cli 24 24 ../../go.mod 25 25 ../../go.sum
-28
nix/packages/client.nix
··· 1 - { 2 - beamPackages, 3 - callPackages, 4 - lib, 5 - version, 6 - }: 7 - 8 - beamPackages.mixRelease { 9 - pname = "sower-client"; 10 - inherit version; 11 - 12 - src = lib.fileset.toSource { 13 - root = ../../client-elixir; 14 - fileset = lib.fileset.unions [ 15 - ../../client-elixir 16 - ]; 17 - }; 18 - 19 - mixNixDeps = callPackages ../../client-elixir/deps.nix { 20 - inherit lib beamPackages; 21 - }; 22 - 23 - # Disable checks for now 24 - doCheck = false; 25 - 26 - meta.mainProgram = "sower_client"; 27 - } 28 -