@@ -19,13 +19,14 @@ import (
1919 * implementation
2020 */
2121
22- // Implements the pq.Gss interface
23- type Gss struct {
22+ // GSS implements the pq.GSS interface.
23+ type GSS struct {
2424 cli * client.Client
2525}
2626
27- func NewGSS () (* Gss , error ) {
28- g := & Gss {}
27+ // NewGSS creates a new GSS provider.
28+ func NewGSS () (* GSS , error ) {
29+ g := & GSS {}
2930 err := g .init ()
3031
3132 if err != nil {
@@ -35,7 +36,7 @@ func NewGSS() (*Gss, error) {
3536 return g , nil
3637}
3738
38- func (g * Gss ) init () error {
39+ func (g * GSS ) init () error {
3940 cfgPath , ok := os .LookupEnv ("KRB5_CONFIG" )
4041 if ! ok {
4142 cfgPath = "/etc/krb5.conf"
@@ -75,7 +76,8 @@ func (g *Gss) init() error {
7576 return nil
7677}
7778
78- func (g * Gss ) GetInitToken (host string , service string ) ([]byte , error ) {
79+ // GetInitToken implements the GSS interface.
80+ func (g * GSS ) GetInitToken (host string , service string ) ([]byte , error ) {
7981
8082 // Resolve the hostname down to an 'A' record, if required (usually, it is)
8183 if g .cli .Config .LibDefaults .DNSCanonicalizeHostname {
@@ -91,7 +93,8 @@ func (g *Gss) GetInitToken(host string, service string) ([]byte, error) {
9193 return g .GetInitTokenFromSpn (spn )
9294}
9395
94- func (g * Gss ) GetInitTokenFromSpn (spn string ) ([]byte , error ) {
96+ // GetInitTokenFromSpn implements the GSS interface.
97+ func (g * GSS ) GetInitTokenFromSpn (spn string ) ([]byte , error ) {
9598 s := spnego .SPNEGOClient (g .cli , spn )
9699
97100 st , err := s .InitSecContext ()
@@ -107,7 +110,8 @@ func (g *Gss) GetInitTokenFromSpn(spn string) ([]byte, error) {
107110 return b , nil
108111}
109112
110- func (g * Gss ) Continue (inToken []byte ) (done bool , outToken []byte , err error ) {
113+ // Continue implements the GSS interface.
114+ func (g * GSS ) Continue (inToken []byte ) (done bool , outToken []byte , err error ) {
111115 t := & spnego.SPNEGOToken {}
112116 err = t .Unmarshal (inToken )
113117 if err != nil {
0 commit comments