github.com/amp-space/amp-sdk-go@v0.7.6/stdlib/utils/state_uri.go (about)

     1  package utils
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  func IsLocalStateURI(stateURI string) bool {
     8  	stateURIParts := strings.Split(stateURI, "/")
     9  	if len(stateURIParts) == 0 {
    10  		return false
    11  	}
    12  	hostnameParts := strings.Split(stateURIParts[0], ".")
    13  	if len(hostnameParts) == 0 {
    14  		return false
    15  	}
    16  	return hostnameParts[len(hostnameParts)-1] == "local"
    17  }