Skip to content

Commit

Permalink
client: add missing deprecation notes
Browse files Browse the repository at this point in the history
  • Loading branch information
magiconair committed Jan 27, 2022
1 parent a3e41d3 commit 9bf9590
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,14 @@ type Session struct {
// "Anonymous" wii be set if it's missing in response.
//
// See Part 4, 5.6.2
//
// Note: Starting with v0.5 this method will require a context
// and the corresponding XXXWithContext(ctx) method will be removed.
func (c *Client) CreateSession(cfg *uasc.SessionConfig) (*Session, error) {
return c.CreateSessionWithContext(context.Background(), cfg)
}

// Note: Starting with v0.5 this method is superseded by the non 'WithContext' method.
func (c *Client) CreateSessionWithContext(ctx context.Context, cfg *uasc.SessionConfig) (*Session, error) {
if c.SecureChannel() == nil {
return nil, ua.StatusBadServerNotConnected
Expand Down Expand Up @@ -730,10 +735,14 @@ func anonymousPolicyID(endpoints []*ua.EndpointDescription) string {
// session call DetachSession.
//
// See Part 4, 5.6.3

//
// Note: Starting with v0.5 this method will require a context
// and the corresponding XXXWithContext(ctx) method will be removed.
func (c *Client) ActivateSession(s *Session) error {
return c.ActivateSessionWithContext(context.Background(), s)
}

// Note: Starting with v0.5 this method is superseded by the non 'WithContext' method.
func (c *Client) ActivateSessionWithContext(ctx context.Context, s *Session) error {
if c.SecureChannel() == nil {
return ua.StatusBadServerNotConnected
Expand Down Expand Up @@ -809,9 +818,14 @@ func (c *Client) ActivateSessionWithContext(ctx context.Context, s *Session) err
// CloseSession closes the current session.
//
// See Part 4, 5.6.4
//
// Note: Starting with v0.5 this method will require a context
// and the corresponding XXXWithContext(ctx) method will be removed.
func (c *Client) CloseSession() error {
return c.CloseSessionWithContext(context.Background())
}

// Note: Starting with v0.5 this method is superseded by the non 'WithContext' method.
func (c *Client) CloseSessionWithContext(ctx context.Context) error {
stats.Client().Add("CloseSession", 1)
if err := c.closeSession(ctx, c.Session()); err != nil {
Expand Down

0 comments on commit 9bf9590

Please sign in to comment.