github.com/cnotch/ipchub@v1.1.0/provider/auth/memory.go (about)

     1  // Copyright (c) 2019,CAOHONGJU All rights reserved.
     2  // Use of this source code is governed by a MIT-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package auth
     6  
     7  type memProvider struct {
     8  }
     9  
    10  func (p *memProvider) Name() string {
    11  	return "memory"
    12  }
    13  
    14  func (p *memProvider) Configure(config map[string]interface{}) error {
    15  	return nil
    16  }
    17  
    18  func (p *memProvider) LoadAll() ([]*User, error) {
    19  	return []*User{{
    20  		Name:     "admin",
    21  		Password: "admin",
    22  		Admin:    true,
    23  	}}, nil
    24  }
    25  
    26  func (p *memProvider) Flush(full []*User, saves []*User, removes []*User) error {
    27  	return nil
    28  }