github.com/polarismesh/polaris@v1.17.8/service/circuitbreaker_config_authability.go (about) 1 /** 2 * Tencent is pleased to support the open source community by making Polaris available. 3 * 4 * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 5 * 6 * Licensed under the BSD 3-Clause License (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * https://opensource.org/licenses/BSD-3-Clause 11 * 12 * Unless required by applicable law or agreed to in writing, software distributed 13 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 14 * CONDITIONS OF ANY KIND, either express or implied. See the License for the 15 * specific language governing permissions and limitations under the License. 16 */ 17 18 package service 19 20 import ( 21 "context" 22 23 apifault "github.com/polarismesh/specification/source/go/api/v1/fault_tolerance" 24 apiservice "github.com/polarismesh/specification/source/go/api/v1/service_manage" 25 ) 26 27 // CreateCircuitBreakers creates circuit breakers 28 func (svr *serverAuthAbility) CreateCircuitBreakers(ctx context.Context, 29 reqs []*apifault.CircuitBreaker) *apiservice.BatchWriteResponse { 30 return svr.targetServer.CreateCircuitBreakers(ctx, reqs) 31 } 32 33 // CreateCircuitBreakerVersions creates circuit breaker versions 34 func (svr *serverAuthAbility) CreateCircuitBreakerVersions(ctx context.Context, 35 reqs []*apifault.CircuitBreaker) *apiservice.BatchWriteResponse { 36 return svr.targetServer.CreateCircuitBreakerVersions(ctx, reqs) 37 } 38 39 // DeleteCircuitBreakers delete circuit breakers 40 func (svr *serverAuthAbility) DeleteCircuitBreakers(ctx context.Context, 41 reqs []*apifault.CircuitBreaker) *apiservice.BatchWriteResponse { 42 return svr.targetServer.DeleteCircuitBreakers(ctx, reqs) 43 } 44 45 // UpdateCircuitBreakers update circuit breakers 46 func (svr *serverAuthAbility) UpdateCircuitBreakers(ctx context.Context, 47 reqs []*apifault.CircuitBreaker) *apiservice.BatchWriteResponse { 48 return svr.targetServer.UpdateCircuitBreakers(ctx, reqs) 49 } 50 51 // ReleaseCircuitBreakers release circuit breakers 52 func (svr *serverAuthAbility) ReleaseCircuitBreakers(ctx context.Context, 53 reqs []*apiservice.ConfigRelease) *apiservice.BatchWriteResponse { 54 return svr.targetServer.ReleaseCircuitBreakers(ctx, reqs) 55 } 56 57 // UnBindCircuitBreakers unbind circuit breakers 58 func (svr *serverAuthAbility) UnBindCircuitBreakers(ctx context.Context, 59 reqs []*apiservice.ConfigRelease) *apiservice.BatchWriteResponse { 60 return svr.targetServer.UnBindCircuitBreakers(ctx, reqs) 61 } 62 63 // GetCircuitBreaker get circuit breaker 64 func (svr *serverAuthAbility) GetCircuitBreaker(ctx context.Context, 65 query map[string]string) *apiservice.BatchQueryResponse { 66 return svr.targetServer.GetCircuitBreaker(ctx, query) 67 } 68 69 // GetCircuitBreakerVersions get circuit breaker versions 70 func (svr *serverAuthAbility) GetCircuitBreakerVersions(ctx context.Context, 71 query map[string]string) *apiservice.BatchQueryResponse { 72 return svr.targetServer.GetCircuitBreakerVersions(ctx, query) 73 } 74 75 // GetMasterCircuitBreakers get master circuit breakers 76 func (svr *serverAuthAbility) GetMasterCircuitBreakers(ctx context.Context, 77 query map[string]string) *apiservice.BatchQueryResponse { 78 return svr.targetServer.GetMasterCircuitBreakers(ctx, query) 79 } 80 81 // GetReleaseCircuitBreakers get release circuit breakers 82 func (svr *serverAuthAbility) GetReleaseCircuitBreakers(ctx context.Context, 83 query map[string]string) *apiservice.BatchQueryResponse { 84 return svr.targetServer.GetReleaseCircuitBreakers(ctx, query) 85 } 86 87 // GetCircuitBreakerByService get circuit breaker by service 88 func (svr *serverAuthAbility) GetCircuitBreakerByService(ctx context.Context, 89 query map[string]string) *apiservice.BatchQueryResponse { 90 return svr.targetServer.GetCircuitBreakerByService(ctx, query) 91 } 92 93 // GetCircuitBreakerToken get circuit breaker token 94 func (svr *serverAuthAbility) GetCircuitBreakerToken( 95 ctx context.Context, req *apifault.CircuitBreaker) *apiservice.Response { 96 return svr.targetServer.GetCircuitBreakerToken(ctx, req) 97 }