Browse Source

En cours de développement

master
mls-361 8 months ago
parent
commit
37db61a5fd
  1. 15
      .editorconfig
  2. 2
      LICENSE
  3. 10
      README.md
  4. 37
      Taskfile.yml
  5. 68
      cmd/main.go
  6. 10
      go.mod
  7. 8
      go.sum

15
.editorconfig

@ -0,0 +1,15 @@
root = true
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.go]
indent_style = tab
[*.md]
trim_trailing_whitespace = false

2
LICENSE

@ -1,4 +1,4 @@
MIT License Copyright (c) <year> <copyright holders>
MIT License Copyright (c) 2021 mls-361
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

10
README.md

@ -1,3 +1,11 @@
# armen
A FAIRE.
A FAIRE.
## Licence
MIT.
---
Copyright (c) 2020-2021 `mls-361`.

37
Taskfile.yml

@ -0,0 +1,37 @@
## https://taskfile.dev
##---------------------
version: '3'
vars:
VERSION: 0.0.0
BUILTAT:
sh: date +%s
LDFLAGS: -s -w -X 'main._version={{.VERSION}}' -X 'main._builtAt={{.BUILTAT}}'
tasks:
lint:
cmds:
- golangci-lint run
test:
cmds:
- go test -cover -v ./...
build:
cmds:
- go build -ldflags "{{.LDFLAGS}}" -o $GOPATH/bin/armen ./cmd/main.go
default:
cmds:
- task: lint
- task: test
- task: build
update:
cmds:
- go get -u forge.chapril.org/armen/armen-sdk
- go get -u forge.chapril.org/armen/armen-jw
- go get -u forge.chapril.org/armen/armen-namespace
- go get -u forge.chapril.org/armen/armen-workers
- go mod tidy

68
cmd/main.go

@ -0,0 +1,68 @@
/*
------------------------------------------------------------------------------------------------------------------------
####### main ####### Copyright (c) 2021 mls-361 #################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package main
import (
"time"
"forge.chapril.org/armen/armen-jw/factory"
"forge.chapril.org/armen/armen-jw/jw"
"forge.chapril.org/armen/armen-jw/model"
"forge.chapril.org/armen/armen-namespace/runner"
"forge.chapril.org/armen/armen-sdk/logger"
"forge.chapril.org/armen/armen-sdk/sdk"
"forge.chapril.org/armen/armen-workers/pool"
)
var (
_version string
_builtAt string
)
func main() {
logger := logger.Default
logger.Trace("armen", sdk.Fields{"version": _version, "builtAt": _builtAt})
model := model.New(&model.Config{})
nsRunner := runner.New("namespace", model)
_ = nsRunner.AddJobHandler("type", runner.JHF(func(job *runner.Job) *jw.Result {
return nil
}))
pool, err := pool.New(&pool.Config{
Size: 1,
Model: model,
})
if err != nil {
logger.Fatal(err.Error(), nil)
return
}
_ = pool.AddRunner(nsRunner)
pool.Start()
time.Sleep(1 * time.Second)
factory := factory.New(model)
_, _ = factory.NewCoreJob("namespace", "type").
UUID().
Name("name").
Origin("Origin").
PriorityLow().
CreateJob()
time.Sleep(2 * time.Second)
pool.Stop()
}
/*
######################################################################################################## @(°_°)@ #######
*/

10
go.mod

@ -0,0 +1,10 @@
module forge.chapril.org/armen/armen
go 1.15
require (
forge.chapril.org/armen/armen-jw v0.0.0-20210405210229-7f528bbffcad
forge.chapril.org/armen/armen-namespace v0.0.0-20210405210322-d42f91eac7a9
forge.chapril.org/armen/armen-sdk v0.0.0-20210404201237-d01a88d7ae37
forge.chapril.org/armen/armen-workers v0.0.0-20210405210354-85716928b185
)

8
go.sum

@ -0,0 +1,8 @@
forge.chapril.org/armen/armen-jw v0.0.0-20210405210229-7f528bbffcad h1:PEZ0pPYMLshjOTdObjohiih7wrjOlSCSOCZR+6mlhho=
forge.chapril.org/armen/armen-jw v0.0.0-20210405210229-7f528bbffcad/go.mod h1:Si2CKSYfciZZWz6+B7jpK5rvXQwTK3so5WDeQYoU2yk=
forge.chapril.org/armen/armen-namespace v0.0.0-20210405210322-d42f91eac7a9 h1:4MyFeAmQF5fpKUT0YFIMLfo5a+gSqPG3ycJ3YpfpQ68=
forge.chapril.org/armen/armen-namespace v0.0.0-20210405210322-d42f91eac7a9/go.mod h1:94d9aHoXb6io5czG11NXl11z3yj0W9IpMzcW2kkY9WM=
forge.chapril.org/armen/armen-sdk v0.0.0-20210404201237-d01a88d7ae37 h1:Rz+f6ei4aZ3rIt5AE0aTgIFAoIbGHDM8jpM2byVA3sc=
forge.chapril.org/armen/armen-sdk v0.0.0-20210404201237-d01a88d7ae37/go.mod h1:we9oWhLZ2hPtsyRDbc6cNih/R+gOpsmK4xJopD2VBOM=
forge.chapril.org/armen/armen-workers v0.0.0-20210405210354-85716928b185 h1:EedR9dHvM9HykqIF5Vib02rjEpYhwekIB2YjTYJLryo=
forge.chapril.org/armen/armen-workers v0.0.0-20210405210354-85716928b185/go.mod h1:NxUZAk/rCK/SgEYb0UPyJc7QMXs2UAasFDeaz/PmHSY=
Loading…
Cancel
Save