go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/nodes/pkg/types/node.go (about)

     1  /*
     2  
     3  Copyright (c) 2023 - Present. Will Charczuk. All rights reserved.
     4  Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository.
     5  
     6  */
     7  
     8  package types
     9  
    10  import (
    11  	"github.com/wcharczuk/go-incr"
    12  )
    13  
    14  // Node is the serialized / api form of the incr node(s).
    15  type Node struct {
    16  	// ID is a unique identifier for the node.
    17  	ID incr.Identifier `json:"id"`
    18  	// Label is the descriptive label for the node.
    19  	Label string `json:"label,omitempty"`
    20  	// Metadata is data that's held on the node metadata field.
    21  	//
    22  	// It will not be data that is inferred from the INode itself.
    23  	Metadata NodeMetadata `json:"metadata"`
    24  
    25  	// these are from the incremental node metadata specifically
    26  	Always                    bool   `json:"always"`
    27  	Observer                  bool   `json:"observer"`
    28  	Valid                     bool   `json:"valid"`
    29  	ChangedAt                 uint64 `json:"changed_at"`
    30  	RecomputedAt              uint64 `json:"recomputed_at"`
    31  	SetAt                     uint64 `json:"set_at"`
    32  	Height                    int    `json:"height"`
    33  	HeightInRecomputeHeap     int    `json:"height_in_recompute_heap"`
    34  	HeightInAdjustHeightsHeap int    `json:"height_in_adjust_heights_heap"`
    35  }