mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 04:00:46 +08:00
fix docs
This commit is contained in:
@@ -10,8 +10,7 @@ import (
|
||||
"github.com/aler9/gortsplib/headers"
|
||||
)
|
||||
|
||||
// Client is an object that helps a client to send its credentials to a
|
||||
// server.
|
||||
// Client is an object that allows a client to authenticate against a server.
|
||||
type Client struct {
|
||||
user string
|
||||
pass string
|
||||
@@ -20,7 +19,7 @@ type Client struct {
|
||||
nonce string
|
||||
}
|
||||
|
||||
// NewClient allocates an Client.
|
||||
// NewClient allocates a Client.
|
||||
// header is the WWW-Authenticate header provided by the server.
|
||||
func NewClient(v base.HeaderValue, user string, pass string) (*Client, error) {
|
||||
// prefer digest
|
||||
|
@@ -12,8 +12,7 @@ import (
|
||||
"github.com/aler9/gortsplib/headers"
|
||||
)
|
||||
|
||||
// Server is an object that helps a server to validate the credentials of
|
||||
// a client.
|
||||
// Server is an object that helps a server to authenticate a client.
|
||||
type Server struct {
|
||||
user string
|
||||
pass string
|
||||
@@ -22,7 +21,7 @@ type Server struct {
|
||||
nonce string
|
||||
}
|
||||
|
||||
// NewServer allocates an Server.
|
||||
// NewServer allocates a Server.
|
||||
// If methods is nil, the Basic and Digest methods are used.
|
||||
func NewServer(user string, pass string, methods []headers.AuthMethod) *Server {
|
||||
if methods == nil {
|
||||
@@ -42,7 +41,8 @@ func NewServer(user string, pass string, methods []headers.AuthMethod) *Server {
|
||||
}
|
||||
}
|
||||
|
||||
// GenerateHeader generates the WWW-Authenticate header needed by a client to log in.
|
||||
// GenerateHeader generates the WWW-Authenticate header needed by a client to
|
||||
// authenticate.
|
||||
func (as *Server) GenerateHeader() base.HeaderValue {
|
||||
var ret base.HeaderValue
|
||||
for _, m := range as.methods {
|
||||
|
Reference in New Issue
Block a user