github.com/juju/juju@v0.0.0-20240327075706-a90865de2538/core/charm/channel.go (about) 1 // Copyright 2020 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package charm 5 6 import ( 7 "github.com/juju/charm/v12" 8 ) 9 10 const ( 11 // DefaultChannelString represents the default track and risk if nothing 12 // is found. 13 DefaultChannelString = "stable" 14 ) 15 16 var ( 17 // DefaultChannel represents the default track and risk. 18 DefaultChannel = charm.Channel{ 19 Risk: charm.Stable, 20 } 21 // DefaultRiskChannel represents the default only risk channel. 22 DefaultRiskChannel = charm.Channel{ 23 Risk: charm.Stable, 24 } 25 ) 26 27 // MustParseChannel parses a given string or returns a panic. 28 func MustParseChannel(s string) charm.Channel { 29 c, err := charm.ParseChannelNormalize(s) 30 if err != nil { 31 panic(err) 32 } 33 return c 34 }