Skip to content

Commit

Permalink
fix error import
Browse files Browse the repository at this point in the history
  • Loading branch information
khorevaa committed Sep 18, 2020
1 parent b282ee2 commit bb2c31e
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 19 deletions.
13 changes: 6 additions & 7 deletions agent/onAgent.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package agent

import (
agent2 "github.com/khorevaa/go-v8platform/agent"
agent "github.com/khorevaa/go-v8platform/agent/client"
"github.com/khorevaa/go-v8platform/types"
agent "github.com/v8platform/agent"
)

type ClientPool struct {
Expand All @@ -21,7 +20,7 @@ type AgentPool struct {
type RunningAgent struct {
connectionString string

agent2.AgentModeOptions
//agent.AgentModeOptions

// Признак запуска конфигуратора в режиме анета
Running bool
Expand All @@ -36,11 +35,11 @@ func (s RunningAgent) Stop() {

}

func (s RunningAgent) Start() error {
func (s RunningAgent) Start() {

go func() {

}()
//go func() {
//
//}()

}

Expand Down
8 changes: 4 additions & 4 deletions agent/pool.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package agent

import agent "github.com/khorevaa/go-v8platform/agent/client"
import agent "github.com/v8platform/agent"

type ClientID string

Expand All @@ -12,9 +12,9 @@ type Pool struct {

func (p *Pool) process() {

p.pool[id] = &Client{
ID: id,
}
//p.pool[id] = &Client{
// ID: id,
//}

p.count++

Expand Down
2 changes: 1 addition & 1 deletion cmd/cmd_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"context"
"github.com/khorevaa/go-v8platform/errors"
"github.com/v8platform/errors"

//"github.com/khorevaa/go-v8platform/errors"
"os"
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ go 1.12
require (
github.com/khorevaa/go-v8platform v0.0.0-20200604183936-0990660c2e4f
github.com/stretchr/testify v1.6.1
github.com/v8platform/agent v0.0.0-20200703051804-b06e6737a7b5
github.com/v8platform/errors v0.1.0
github.com/v8platform/find v0.0.0-20200629131701-72a40bdf1034
github.com/v8platform/marshaler v0.0.0-20200630110446-ab0bd14c5414
golang.org/x/text v0.3.3
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,19 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/v8platform/agent v0.0.0-20200703051804-b06e6737a7b5 h1:exdR2JPaLRuRvaLLyPzVHAZV7KkQGrblL2ch5J3Dkpg=
github.com/v8platform/agent v0.0.0-20200703051804-b06e6737a7b5/go.mod h1:fLdJkSja8K++qa7+Lw4RQBHsEdS18GcE2F2BlFK33Z4=
github.com/v8platform/errors v0.1.0 h1:7167okMmxBb76FA3+irT4LW9KTVura0vhMWnFDMHcZw=
github.com/v8platform/errors v0.1.0/go.mod h1:7tASRzzC2AeE0NrQaYT6qfGO2alI0hW91fpoC3lPbQA=
github.com/v8platform/find v0.0.0-20200629131701-72a40bdf1034 h1:tUWtou0ZdFgxfiePSkO9uQGuN+GkrA4nEWDjOb/OqZ8=
github.com/v8platform/find v0.0.0-20200629131701-72a40bdf1034/go.mod h1:tfhUIhAlIplptMrqi6I2+ygI4CIsbMwCR1SMQ/4tDC0=
github.com/v8platform/marshaler v0.0.0-20200630110446-ab0bd14c5414 h1:ME4MvcuTion7r6lDWihTwgUnoFTzj47Kh4PLbtWegbc=
github.com/v8platform/marshaler v0.0.0-20200630110446-ab0bd14c5414/go.mod h1:te7WaUpacxK3+jPl1Q9JtkxdNrgtxyAvmM1f3NFvLz8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI=
Expand Down
10 changes: 4 additions & 6 deletions runner.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package runner

import (
"github.com/khorevaa/go-v8platform/errors"
"github.com/v8platform/errors"
"github.com/v8platform/find"
"github.com/v8platform/runner/cmd"
"strings"
Expand Down Expand Up @@ -209,14 +209,12 @@ func getOptions(opts ...interface{}) *Options {

for _, opt := range opts {

switch opt.(type) {
switch o := opt.(type) {

case Options:
userOptions, _ := opt.(Options)
return &userOptions
return &o
case *Options:
userOptions, _ := opt.(*Options)
return userOptions
return o
}

}
Expand Down
102 changes: 101 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
package runner

import "fmt"

//
//type Params interface {
// Set(key, sep, value string)
// Append(v2 Params)
// Values() []Param
// StringValues() []string
// String() string
//}

type Param interface {
Key() string
Sep() string
Value() string
}

type Infobase interface {
// Clear path
Path() string
// Возвращает
// - /IBConnectionString <СтрокаПодключения>
Expand All @@ -16,3 +32,87 @@ type Command interface {
Check() error
Values() []string
}

type Values struct {
keys []string
values map[string]Param
}

func (v Values) Len() int {
return len(v.keys)
}

type param struct {
key string
sep string
val string
}

func (v param) Key() string {
return v.key
}
func (v param) Sep() string {
return v.sep
}
func (v param) Value() string {
return v.val
}

type ValueSep string

func NewValues() *Values {
return &Values{
values: make(map[string]Param),
}
}

const (
SpaceSep ValueSep = " "
EqualSep ValueSep = "="
NoSep ValueSep = ""
)

func (v *Values) Values() []string {

var str []string

for _, value := range v.values {
str = append(str, fmt.Sprintf("%s%s", value.Sep(), value.Value()))
}

return str
}

func (v *Values) Set(key string, sep string, value string) {

v.Map(param{
key, sep, value,
})

}

func (v *Values) Map(val Param) {

key := val.Key()

_, ok := v.values[key]

if !ok {
v.keys = append(v.keys, key)
}

v.values[key] = val

}

func (v *Values) GetMap() {

}

func (v *Values) Append(v2 Params) {

//for _, s2 := range v2.Len() {
// v.Map(s2.key, s2.val)
//}

}

0 comments on commit bb2c31e

Please sign in to comment.