agola/services/types/arch.go
Simone Gotti c1ff28ef9f *: export clients and related types
Export clients and related packages.

The main rule is to not import internal packages from exported packages.

The gateway client and related types are totally decoupled from the gateway
service (not shared types between the client and the server).

Instead the configstore and the runservice client currently share many types
that are now exported (decoupling them will require that a lot of types must be
duplicated and the need of functions to convert between them, this will be done
in future when the APIs will be declared as stable).
2019-08-02 12:02:01 +02:00

45 lines
1.0 KiB
Go

// Copyright 2019 Sorint.lab
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
// See the License for the specific language governing permissions and
// limitations under the License.
package types
type Arch string
const (
Arch386 Arch = "386"
ArchAMD64 Arch = "amd64"
ArchARM Arch = "arm"
ArchARM64 Arch = "arm64"
)
var ValidArchs = []Arch{Arch386, ArchAMD64, ArchARM, ArchARM64}
func IsValidArch(arch Arch) bool {
for _, va := range ValidArchs {
if arch == va {
return true
}
}
return false
}
func ArchFromString(arch string) Arch {
for _, va := range ValidArchs {
if arch == string(va) {
return va
}
}
return ""
}