...

Source file src/go.formulabun.club/translator/server/go/model_server_info.go

Documentation: go.formulabun.club/translator/server/go

     1  /*
     2   * Translator service between a srb2kart server and json
     3   *
     4   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     5   *
     6   * API version: 0.0.1
     7   * Generated by: OpenAPI Generator (https://openapi-generator.tech)
     8   */
     9  
    10  package openapi
    11  
    12  type ServerInfo struct {
    13  
    14  	PacketVersion uint8 `json:"PacketVersion,omitempty"`
    15  
    16  	Application string `json:"Application,omitempty"`
    17  
    18  	Version uint8 `json:"Version,omitempty"`
    19  
    20  	SubVersion uint8 `json:"SubVersion,omitempty"`
    21  
    22  	NumberOfPlayer uint8 `json:"NumberOfPlayer,omitempty"`
    23  
    24  	MaxPlayers uint8 `json:"MaxPlayers,omitempty"`
    25  
    26  	GameType uint8 `json:"GameType,omitempty"`
    27  
    28  	ModifiedGame bool `json:"ModifiedGame,omitempty"`
    29  
    30  	CheatsEnabled bool `json:"CheatsEnabled,omitempty"`
    31  
    32  	KartVars uint8 `json:"KartVars,omitempty"`
    33  
    34  	FileNeededNum uint8 `json:"FileNeededNum,omitempty"`
    35  
    36  	Time uint32 `json:"Time,omitempty"`
    37  
    38  	LevelTime uint32 `json:"LevelTime,omitempty"`
    39  
    40  	ServerNameRaw string `json:"ServerNameRaw,omitempty"`
    41  
    42  	MapName string `json:"MapName,omitempty"`
    43  
    44  	MapTitle string `json:"MapTitle,omitempty"`
    45  
    46  	MapMD5 [16]byte `json:"MapMD5,omitempty"`
    47  
    48  	ActNum uint8 `json:"ActNum,omitempty"`
    49  
    50  	IsZone bool `json:"IsZone,omitempty"`
    51  
    52  	HttpSource string `json:"HttpSource,omitempty"`
    53  
    54  	FileNeeded []FileNeededInner `json:"FileNeeded,omitempty"`
    55  }
    56  
    57  // AssertServerInfoRequired checks if the required fields are not zero-ed
    58  func AssertServerInfoRequired(obj ServerInfo) error {
    59  	for _, el := range obj.FileNeeded {
    60  		if err := AssertFileNeededInnerRequired(el); err != nil {
    61  			return err
    62  		}
    63  	}
    64  	return nil
    65  }
    66  
    67  // AssertRecurseServerInfoRequired recursively checks if required fields are not zero-ed in a nested slice.
    68  // Accepts only nested slice of ServerInfo (e.g. [][]ServerInfo), otherwise ErrTypeAssertionError is thrown.
    69  func AssertRecurseServerInfoRequired(objSlice interface{}) error {
    70  	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
    71  		aServerInfo, ok := obj.(ServerInfo)
    72  		if !ok {
    73  			return ErrTypeAssertionError
    74  		}
    75  		return AssertServerInfoRequired(aServerInfo)
    76  	})
    77  }
    78  

View as plain text