hunk.code_window:       },
         runSwarm: {
           command: [
             'docker stop portainer',
             'docker rm portainer',
             'docker run -d -p 9000:9000 --name portainer portainer -H tcp://10.0.7.10:2375'
           ].join(';')
         },
         runSwarmLocal: {
           command: [
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit:           'docker run -d -p 9000:9000 --name portainer portainer -H tcp://10.0.7.10:2375 --no-analytics'
  
hunk.file_path: gruntfile.js
hunk.type: replace
file: package bolt
  
  import (
  	"github.com/portainer/portainer"
  	"github.com/portainer/portainer/bolt/internal"
  
  	"github.com/boltdb/bolt"
  )
  
  // UserService represents a service for managing users.
  type UserService struct {
  	store *Store
  }
  
  // User returns a user by username.
  func (service *UserService) User(username string) (*portainer.User, error) {
  	var data []byte
  	err := service.store.db.View(func(tx *bolt.Tx) error {
  		bucket := tx.Bucket([]byte(userBucketName))
  		value := bucket.Get([]byte(username))
  		if value == nil {
  			return portainer.ErrUserNotFound
  		}
  
  		data = make([]byte, len(value))
  		copy(data, value)
  		return nil
  	})
  	if err != nil {
  		return nil, err
  	}
  
  	var user portainer.User
  	err = internal.UnmarshalUser(data, &user)
  	if err != nil {
  		return nil, err
  	}
  	return &user, nil
  }
  
  // UpdateUser saves a user.
  func (service *UserService) UpdateUser(user *portainer.User) error {
  	data, err := internal.MarshalUser(user)
  	if err != nil {
  		return err
  	}
  
  	return service.store.db.Update(func(tx *bolt.Tx) error {
  		bucket := tx.Bucket([]byte(userBucketName))
  		err = bucket.Put([]byte(user.Username), data)
  		if err != nil {
  			return err
  		}
  		return nil
  	})
  }
  