Compare commits

...

2 commits

Author SHA1 Message Date
5e82e8c776 [#115] netmap: Fix type getters
All checks were successful
DCO action / DCO (pull_request) Successful in 39s
Tests and linters / Lint (pull_request) Successful in 44s
Tests and linters / Tests (pull_request) Successful in 48s
Tests and linters / Tests with -race (pull_request) Successful in 1m11s
* Add type instance check for nil to avoid panic by
  accessing fields.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-09-06 12:13:18 +03:00
8f268ad512 [#115] apemanager: Fix type getters
* Add type instance check for nil to avoid panic by
  accessing fields.

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
2024-09-06 12:11:28 +03:00
4 changed files with 72 additions and 0 deletions

View file

@ -330,10 +330,18 @@ func (bt *BearerTokenBody) SetEACL(v *Table) {
}
func (t *APEOverride) GetTarget() *ape.ChainTarget {
if t == nil {
return nil
}
return t.target
}
func (t *APEOverride) GetChains() []*ape.Chain {
if t == nil {
return nil
}
return t.chains
}

View file

@ -53,6 +53,10 @@ func (c *Chain) SetKind(kind chainKind) {
}
func (c *Chain) GetKind() chainKind {
if c == nil {
return nil
}
return c.kind
}
@ -67,5 +71,9 @@ func (c *ChainRaw) SetRaw(raw []byte) {
}
func (c *ChainRaw) GetRaw() []byte {
if c == nil {
return nil
}
return c.Raw
}

View file

@ -16,6 +16,10 @@ func (r *AddChainRequest) SetBody(body *AddChainRequestBody) {
}
func (r *AddChainRequest) GetBody() *AddChainRequestBody {
if r == nil {
return nil
}
return r.body
}
@ -30,6 +34,10 @@ func (rb *AddChainRequestBody) SetTarget(target *ape.ChainTarget) {
}
func (rb *AddChainRequestBody) GetTarget() *ape.ChainTarget {
if rb == nil {
return nil
}
return rb.target
}
@ -38,6 +46,10 @@ func (rb *AddChainRequestBody) SetChain(chain *ape.Chain) {
}
func (rb *AddChainRequestBody) GetChain() *ape.Chain {
if rb == nil {
return nil
}
return rb.chain
}
@ -52,6 +64,10 @@ func (r *AddChainResponse) SetBody(body *AddChainResponseBody) {
}
func (r *AddChainResponse) GetBody() *AddChainResponseBody {
if r == nil {
return nil
}
return r.body
}
@ -64,6 +80,10 @@ func (rb *AddChainResponseBody) SetChainID(chainID []byte) {
}
func (rb *AddChainResponseBody) GetChainID() []byte {
if rb == nil {
return nil
}
return rb.chainID
}
@ -78,6 +98,10 @@ func (r *RemoveChainRequest) SetBody(body *RemoveChainRequestBody) {
}
func (r *RemoveChainRequest) GetBody() *RemoveChainRequestBody {
if r == nil {
return nil
}
return r.body
}
@ -92,6 +116,10 @@ func (rb *RemoveChainRequestBody) SetTarget(target *ape.ChainTarget) {
}
func (rb *RemoveChainRequestBody) GetTarget() *ape.ChainTarget {
if rb == nil {
return nil
}
return rb.target
}
@ -100,6 +128,10 @@ func (rb *RemoveChainRequestBody) SetChainID(chainID []byte) {
}
func (rb *RemoveChainRequestBody) GetChainID() []byte {
if rb == nil {
return nil
}
return rb.chainID
}
@ -116,6 +148,10 @@ func (r *RemoveChainResponse) SetBody(body *RemoveChainResponseBody) {
}
func (r *RemoveChainResponse) GetBody() *RemoveChainResponseBody {
if r == nil {
return nil
}
return r.body
}
@ -130,6 +166,10 @@ func (r *ListChainsRequest) SetBody(body *ListChainsRequestBody) {
}
func (r *ListChainsRequest) GetBody() *ListChainsRequestBody {
if r == nil {
return nil
}
return r.body
}
@ -142,6 +182,10 @@ func (rb *ListChainsRequestBody) SetTarget(target *ape.ChainTarget) {
}
func (rb *ListChainsRequestBody) GetTarget() *ape.ChainTarget {
if rb == nil {
return nil
}
return rb.target
}
@ -156,6 +200,10 @@ func (r *ListChainsResponse) SetBody(body *ListChainsResponseBody) {
}
func (r *ListChainsResponse) GetBody() *ListChainsResponseBody {
if r == nil {
return nil
}
return r.body
}
@ -170,5 +218,9 @@ func (r *ListChainsResponseBody) SetChains(chains []*ape.Chain) {
}
func (r *ListChainsResponseBody) GetChains() []*ape.Chain {
if r == nil {
return nil
}
return r.chains
}

View file

@ -335,6 +335,10 @@ func (p *PlacementPolicy) SetContainerBackupFactor(backupFactor uint32) {
}
func (p *PlacementPolicy) GetReplicas() []Replica {
if p == nil {
return nil
}
return p.replicas
}