github.com/sacloud/iaas-api-go@v1.12.0/types/upstream_network_type.go (about)

     1  // Copyright 2022-2023 The sacloud/iaas-api-go Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package types
    16  
    17  // EUpstreamNetworkType 上流ネットワーク種別
    18  type EUpstreamNetworkType string
    19  
    20  // String EUpstreamNetworkTypeの文字列表現
    21  func (t EUpstreamNetworkType) String() string {
    22  	return string(t)
    23  }
    24  
    25  var (
    26  	// UpstreamNetworkTypes 上流ネットワーク種別
    27  	UpstreamNetworkTypes = struct {
    28  		Unknown EUpstreamNetworkType
    29  		// Shared 共有セグメント
    30  		Shared EUpstreamNetworkType
    31  		// Switch スイッチ
    32  		Switch EUpstreamNetworkType
    33  		// Router ルータ
    34  		Router EUpstreamNetworkType
    35  		// None 接続なし
    36  		None EUpstreamNetworkType
    37  	}{
    38  		Unknown: EUpstreamNetworkType("unknown"),
    39  		Shared:  EUpstreamNetworkType("shared"),
    40  		Switch:  EUpstreamNetworkType("switch"),
    41  		Router:  EUpstreamNetworkType("router"),
    42  		None:    EUpstreamNetworkType("none"),
    43  	}
    44  
    45  	// UpstreamNetworkTypeMap 文字列とEUpstreamNetworkTypeのマッピング
    46  	UpstreamNetworkTypeMap = map[string]EUpstreamNetworkType{
    47  		"unknown": UpstreamNetworkTypes.Unknown,
    48  		"shared":  UpstreamNetworkTypes.Shared,
    49  		"switch":  UpstreamNetworkTypes.Switch,
    50  		"router":  UpstreamNetworkTypes.Router,
    51  		"none":    UpstreamNetworkTypes.None,
    52  	}
    53  )