github.com/hashgraph/hedera-sdk-go/v2@v2.48.0/channel.go (about) 1 package hedera 2 3 /*- 4 * 5 * Hedera Go SDK 6 * 7 * Copyright (C) 2020 - 2024 Hedera Hashgraph, LLC 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 */ 22 23 import ( 24 "github.com/hashgraph/hedera-protobufs-go/services" 25 "google.golang.org/grpc" 26 ) 27 28 type _Channel struct { 29 crypto services.CryptoServiceClient 30 file services.FileServiceClient 31 contract services.SmartContractServiceClient 32 topic services.ConsensusServiceClient 33 freeze services.FreezeServiceClient 34 network services.NetworkServiceClient 35 token services.TokenServiceClient 36 schedule services.ScheduleServiceClient 37 util services.UtilServiceClient 38 addressBook services.AddressBookServiceClient 39 client *grpc.ClientConn 40 } 41 42 func _NewChannel(client *grpc.ClientConn) _Channel { 43 return _Channel{ 44 client: client, 45 } 46 } 47 48 func (channel _Channel) _GetCrypto() services.CryptoServiceClient { 49 if channel.crypto == nil { 50 channel.crypto = services.NewCryptoServiceClient(channel.client) 51 } 52 53 return channel.crypto 54 } 55 56 func (channel _Channel) _GetFile() services.FileServiceClient { 57 if channel.file == nil { 58 channel.file = services.NewFileServiceClient(channel.client) 59 } 60 61 return channel.file 62 } 63 64 func (channel _Channel) _GetContract() services.SmartContractServiceClient { 65 if channel.contract == nil { 66 channel.contract = services.NewSmartContractServiceClient(channel.client) 67 } 68 69 return channel.contract 70 } 71 72 func (channel _Channel) _GetTopic() services.ConsensusServiceClient { 73 if channel.topic == nil { 74 channel.topic = services.NewConsensusServiceClient(channel.client) 75 } 76 77 return channel.topic 78 } 79 80 func (channel _Channel) _GetFreeze() services.FreezeServiceClient { 81 if channel.freeze == nil { 82 channel.freeze = services.NewFreezeServiceClient(channel.client) 83 } 84 85 return channel.freeze 86 } 87 88 func (channel _Channel) _GetNetwork() services.NetworkServiceClient { 89 if channel.network == nil { 90 channel.network = services.NewNetworkServiceClient(channel.client) 91 } 92 93 return channel.network 94 } 95 96 func (channel _Channel) _GetToken() services.TokenServiceClient { 97 if channel.token == nil { 98 channel.token = services.NewTokenServiceClient(channel.client) 99 } 100 101 return channel.token 102 } 103 104 func (channel _Channel) _GetSchedule() services.ScheduleServiceClient { 105 if channel.schedule == nil { 106 channel.schedule = services.NewScheduleServiceClient(channel.client) 107 } 108 109 return channel.schedule 110 } 111 112 func (channel _Channel) _GetUtil() services.UtilServiceClient { 113 if channel.util == nil { 114 channel.util = services.NewUtilServiceClient(channel.client) 115 } 116 117 return channel.util 118 } 119 120 func (channel _Channel) _GetAddressBook() services.AddressBookServiceClient { 121 if channel.addressBook == nil { 122 channel.addressBook = services.NewAddressBookServiceClient(channel.client) 123 } 124 125 return channel.addressBook 126 }