Git Product home page Git Product logo

Comments (7)

cuisongliu avatar cuisongliu commented on August 21, 2024
const (
	DefaultSecretPrefix = "fist-user-"
)

type User struct {
	Name   string  `json:"name"`
	Passwd string  `json:"passwd,omitempty"`
}

type UserService interface {
	GetUser() error   // GET
	Login()               //POST
	AddUser()         //POST
	DelUser()          //DELETE
	UpdateUser()   //PUT
}

用户的增删改查。
登录时 需要先判断是否是admin 在进行登录验证。

from fist.

fanux avatar fanux commented on August 21, 2024

是否有必要加用户组信息

type User struct {
	Name   string  `json:"name"`
	Passwd string  `json:"passwd,omitempty"`
        Groups []string `json:"groups"`
}

没有关系型数据库确实有点不太好维护。

from fist.

cuisongliu avatar cuisongliu commented on August 21, 2024
const (
	DefaultSecretPrefix = "fist-user-"
)

type User struct {
	Name   string  `json:"name"`
	Passwd string  `json:"passwd,omitempty"`
  Groups []string `json:"groups"`
}

type UserService interface {
	GetUser() error   // GET
	AddUser()         //POST
	DelUser()          //DELETE
	UpdateUser()   //PUT
}

from fist.

fanux avatar fanux commented on August 21, 2024

后续可能会增加一些字段或者接口,如ListUsers(), 先就这样就可以了。 我在想管理员的账户密码能不能同样走这个接口

from fist.

cuisongliu avatar cuisongliu commented on August 21, 2024

管理员只涉及到 GetUser这个接口吧 ?那 进入系统后可以自建管理员么? 那这样需要把admin和用户重构一下设计。

from fist.

fanux avatar fanux commented on August 21, 2024

看了一下,管理员的就先不动。 User的可以开始写了,还好。 然后对secret的操作可以再封装一层:

SetSecret(screct string, key , value string)
GetSecret(secret string)map[string]string //或 GetSecret(secret string, key string) value string

然后就是kubeclientset, 感觉我们用的有点乱,是不是搞个全局的就行了。用个单例模式

from fist.

cuisongliu avatar cuisongliu commented on August 21, 2024

统一了所有的kubeclientset
分离每个k8s组件
k8s_(deploy,svc,ns).go
单独放自己相关组件的工具类
重新整了了所有的日志处理

from fist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.