Use go module as dependency tool instead of glide
[src/xds/xds-server.git] / lib / xdsconfig / builderconfig.go
index c64fe9c..965e6e7 100644 (file)
@@ -1,26 +1,38 @@
+/*
+ * Copyright (C) 2017-2018 "IoT.bzh"
+ * Author Sebastien Douheret <sebastien@iot.bzh>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 package xdsconfig
 
 import (
        "errors"
        "net"
-)
 
-// BuilderConfig represents the builder container configuration
-type BuilderConfig struct {
-       IP          string `json:"ip"`
-       Port        string `json:"port"`
-       SyncThingID string `json:"syncThingID"`
-}
+       "gerrit.automotivelinux.org/gerrit/src/xds/xds-server.git/lib/xsapiv1"
+)
 
 // NewBuilderConfig creates a new BuilderConfig instance
-func NewBuilderConfig(stID string) (BuilderConfig, error) {
+func NewBuilderConfig(stID string) (xsapiv1.BuilderConfig, error) {
        // Do we really need it ? may be not accessible from client side
        ip, err := getLocalIP()
        if err != nil {
-               return BuilderConfig{}, err
+               return xsapiv1.BuilderConfig{}, err
        }
 
-       b := BuilderConfig{
+       b := xsapiv1.BuilderConfig{
                IP:          ip, // TODO currently not used
                Port:        "", // TODO currently not used
                SyncThingID: stID,
@@ -28,10 +40,7 @@ func NewBuilderConfig(stID string) (BuilderConfig, error) {
        return b, nil
 }
 
-// Copy makes a real copy of BuilderConfig
-func (c *BuilderConfig) Copy(n BuilderConfig) {
-       // TODO
-}
+/*** Private ***/
 
 func getLocalIP() (string, error) {
        addrs, err := net.InterfaceAddrs()