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