github.com/nacos-group/nacos-sdk-go@v1.1.4/clients/config_client/config_client_interface.go (about)

     1  /*
     2   * Copyright 1999-2020 Alibaba Group Holding Ltd.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   *      http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package config_client
    18  
    19  import (
    20  	"github.com/nacos-group/nacos-sdk-go/model"
    21  	"github.com/nacos-group/nacos-sdk-go/vo"
    22  )
    23  
    24  //go:generate mockgen -destination ../../mock/mock_config_client_interface.go -package mock -source=./config_client_interface.go
    25  
    26  type IConfigClient interface {
    27  	// GetConfig use to get config from nacos server
    28  	// dataId  require
    29  	// group   require
    30  	// tenant ==>nacos.namespace optional
    31  	GetConfig(param vo.ConfigParam) (string, error)
    32  
    33  	// PublishConfig use to publish config to nacos server
    34  	// dataId  require
    35  	// group   require
    36  	// content require
    37  	// tenant ==>nacos.namespace optional
    38  	PublishConfig(param vo.ConfigParam) (bool, error)
    39  
    40  	// DeleteConfig use to delete config
    41  	// dataId  require
    42  	// group   require
    43  	// tenant ==>nacos.namespace optional
    44  	DeleteConfig(param vo.ConfigParam) (bool, error)
    45  
    46  	// ListenConfig use to listen config change,it will callback OnChange() when config change
    47  	// dataId  require
    48  	// group   require
    49  	// onchange require
    50  	// tenant ==>nacos.namespace optional
    51  	ListenConfig(params vo.ConfigParam) (err error)
    52  
    53  	//CancelListenConfig use to cancel listen config change
    54  	// dataId  require
    55  	// group   require
    56  	// tenant ==>nacos.namespace optional
    57  	CancelListenConfig(params vo.ConfigParam) (err error)
    58  
    59  	// SearchConfig use to search nacos config
    60  	// search  require search=accurate--精确搜索  search=blur--模糊搜索
    61  	// group   option
    62  	// dataId  option
    63  	// tenant ==>nacos.namespace optional
    64  	// pageNo  option,default is 1
    65  	// pageSize option,default is 10
    66  	SearchConfig(param vo.SearchConfigParam) (*model.ConfigPage, error)
    67  
    68  	PublishAggr(param vo.ConfigParam) (published bool, err error)
    69  }