MCPcopy Create free account
hub / github.com/actiontech/dtle / SaveRole

Method SaveRole

driver/common/store.go:570–578  ·  view source on GitHub ↗
(role *Role)

Source from the content-addressed store, hash-verified

568}
569
570func (sm *StoreManager) SaveRole(role *Role) error {
571 key := fmt.Sprintf("dtleRole/%v/%v", role.Tenant, role.Name)
572 jobBytes, err := json.Marshal(role)
573 if err != nil {
574 return fmt.Errorf("save %v to consul, marshal err : %v", key, err)
575 }
576 err = sm.consulStore.Put(key, jobBytes, nil)
577 return err
578}
579
580func (sm *StoreManager) DeleteRole(tenant, name string) error {
581 key := fmt.Sprintf("dtleRole/%v/%v", tenant, name)

Callers 2

UpdateRoleInfoFunction · 0.95
createUserFunction · 0.95

Calls 1

MarshalMethod · 0.65

Tested by

no test coverage detected