X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=lib%2Fxdsserver%2Ffolder-st-disable.go;h=fb1def24651379a5b5d4e138c7319857cae70a99;hb=5dc2ff003106f0ced38caadb06033f24c792f9b9;hp=64b1efcb549dc8dbdfc53061444a3e291553da03;hpb=2f7828d01f4c4ca2909f95f098627cd5475ed225;p=src%2Fxds%2Fxds-server.git diff --git a/lib/xdsserver/folder-st-disable.go b/lib/xdsserver/folder-st-disable.go index 64b1efc..fb1def2 100644 --- a/lib/xdsserver/folder-st-disable.go +++ b/lib/xdsserver/folder-st-disable.go @@ -1,7 +1,24 @@ +/* + * Copyright (C) 2017-2018 "IoT.bzh" + * Author Sebastien Douheret + * + * 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 xdsserver import ( - "github.com/iotbzh/xds-server/lib/xsapiv1" + "gerrit.automotivelinux.org/gerrit/src/xds/xds-server.git/lib/xsapiv1" uuid "github.com/satori/go.uuid" ) @@ -12,7 +29,7 @@ import ( // STFolderDisable . type STFolderDisable struct { *Context - config xsapiv1.FolderConfig + fConfig xsapiv1.FolderConfig } // NewFolderSTDisable Create a new instance of STFolderDisable @@ -34,15 +51,20 @@ func (f *STFolderDisable) NewUID(suffix string) string { // Add a new folder func (f *STFolderDisable) Add(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) { - f.config = cfg - f.config.Status = xsapiv1.StatusDisable - f.config.IsInSync = false - return &f.config, nil + return f.Setup(cfg) +} + +// Setup Setup local project config +func (f *STFolderDisable) Setup(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfig, error) { + f.fConfig = cfg + f.fConfig.Status = xsapiv1.StatusDisable + f.fConfig.IsInSync = false + return &f.fConfig, nil } // GetConfig Get public part of folder config func (f *STFolderDisable) GetConfig() xsapiv1.FolderConfig { - return f.config + return f.fConfig } // GetFullPath returns the full path of a directory (from server POV) @@ -70,16 +92,6 @@ func (f *STFolderDisable) Update(cfg xsapiv1.FolderConfig) (*xsapiv1.FolderConfi return nil, nil } -// RegisterEventChange requests registration for folder change event -func (f *STFolderDisable) RegisterEventChange(cb *FolderEventCB, data *FolderEventCBData) error { - return nil -} - -// UnRegisterEventChange remove registered callback -func (f *STFolderDisable) UnRegisterEventChange() error { - return nil -} - // Sync Force folder files synchronization func (f *STFolderDisable) Sync() error { return nil