remove Get from function names

This commit is contained in:
aler9
2020-07-18 13:49:58 +02:00
parent 4754822be1
commit 1d365c8c93
2 changed files with 6 additions and 6 deletions

View File

@@ -334,7 +334,7 @@ func (c *ConnClient) SetupUdp(u *url.URL, track *Track, rtpPort int,
return 0, 0, nil, fmt.Errorf("SETUP: transport header: %s", err)
}
rtpServerPort, rtcpServerPort := th.GetPorts("server_port")
rtpServerPort, rtcpServerPort := th.Ports("server_port")
if rtpServerPort == 0 {
return 0, 0, nil, fmt.Errorf("SETUP: server ports not provided")
}

View File

@@ -27,8 +27,8 @@ func ReadHeaderTransport(v HeaderValue) (HeaderTransport, error) {
return ht, nil
}
// GetValue gets a value from the header.
func (ht HeaderTransport) GetValue(key string) string {
// Value gets a value from the header.
func (ht HeaderTransport) Value(key string) string {
prefix := key + "="
for t := range ht {
if strings.HasPrefix(t, prefix) {
@@ -38,9 +38,9 @@ func (ht HeaderTransport) GetValue(key string) string {
return ""
}
// GetPorts gets a given header value and parses its ports.
func (ht HeaderTransport) GetPorts(key string) (int, int) {
val := ht.GetValue(key)
// Ports gets a given header value and parses its ports.
func (ht HeaderTransport) Ports(key string) (int, int) {
val := ht.Value(key)
if val == "" {
return 0, 0
}