...

Source file src/github.com/lib/pq/krb.go

Documentation: github.com/lib/pq

     1  package pq
     2  
     3  // NewGSSFunc creates a GSS authentication provider, for use with
     4  // RegisterGSSProvider.
     5  type NewGSSFunc func() (GSS, error)
     6  
     7  var newGss NewGSSFunc
     8  
     9  // RegisterGSSProvider registers a GSS authentication provider. For example, if
    10  // you need to use Kerberos to authenticate with your server, add this to your
    11  // main package:
    12  //
    13  //	import "github.com/lib/pq/auth/kerberos"
    14  //
    15  //	func init() {
    16  //		pq.RegisterGSSProvider(func() (pq.GSS, error) { return kerberos.NewGSS() })
    17  //	}
    18  func RegisterGSSProvider(newGssArg NewGSSFunc) {
    19  	newGss = newGssArg
    20  }
    21  
    22  // GSS provides GSSAPI authentication (e.g., Kerberos).
    23  type GSS interface {
    24  	GetInitToken(host string, service string) ([]byte, error)
    25  	GetInitTokenFromSpn(spn string) ([]byte, error)
    26  	Continue(inToken []byte) (done bool, outToken []byte, err error)
    27  }
    28  

View as plain text